Skip to content

Instantly share code, notes, and snippets.

@dbarkley
Created March 31, 2014 14:26
Show Gist options
  • Save dbarkley/9893505 to your computer and use it in GitHub Desktop.
Save dbarkley/9893505 to your computer and use it in GitHub Desktop.
function espresso_email_after_payment($payment_data) {
global $org_options;
if ($payment_data['payment_status'] == 'Completed') {
event_espresso_send_payment_notification(array('attendee_id' => $payment_data['attendee_id'], 'registration_id' => $payment_data['registration_id']));
$send_admin_email = 'true';
if ( is_user_logged_in() ) {
$send_admin_email = 'false';
}
if ($org_options['email_before_payment'] == 'N') {
event_espresso_email_confirmations(array('session_id' => $payment_data['attendee_session'], 'send_admin_email' => $send_admin_email, 'send_attendee_email' => 'true'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment