Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Created October 21, 2013 16:03
Show Gist options
  • Select an option

  • Save sidharrell/7086385 to your computer and use it in GitHub Desktop.

Select an option

Save sidharrell/7086385 to your computer and use it in GitHub Desktop.
email admin attendee cancelled notice
// substitute for lines 25-30 in my_events_page.php
while(list($key,$value)=each($_POST['checkbox'])):
$data = espresso_prepare_email_data($key, FALSE);
event_espresso_send_email(array(
'send_to' => $data->event->alt_email == '' ? $org_options['contact_email'] : $data->event->alt_email . ',' . $org_options['contact_email'],
'email_subject' => $data->event->event_name . ' ' . __('registration cancellation', 'event_espresso'),
'email_body' => $data->attendee->email . " | " . $data->attendee->lname . ", " . $data->attendee->fname . "<br>"
. "has cancelled for event:<br>"
. stripslashes_deep($data->event->event_name) . " | " . $data->attendee->price_option . "<br>"
. event_date_display($data->attendee->start_date) . ' - ' . event_date_display($data->attendee->end_date) . "<br>"
. event_date_display($data->attendee->event_time, get_option('time_format')) . " - " . event_date_display($data->attendee->end_time, get_option('time_format')) . "<br>"
. "They paid a total of " . $data->attendee->amount_pd . ". They paid using payment option " . $data->attendee->txn_type,
'headers' => ''
));
$del_attendee = $wpdb->prepare("DELETE FROM " . EVENTS_ATTENDEE_TABLE . " WHERE id = %d", $key );
$wpdb->query( $del_attendee );
$del_attendee_member_rel = $wpdb->prepare("DELETE FROM " . EVENTS_MEMBER_REL_TABLE . " WHERE attendee_id = %d and user_id = %d", $key, $userid );
$wpdb->query( $del_attendee_member_rel );
endwhile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment