Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rafiahmedd/4f769b982f8429fc527f4f80e2372516 to your computer and use it in GitHub Desktop.
Save rafiahmedd/4f769b982f8429fc527f4f80e2372516 to your computer and use it in GitHub Desktop.
Trigger an email when payment status changed
add_action('fluentform_after_payment_status_change', 'emailNotification',10,2);
function emailNotification($newStatus, $submission){
if($newStatus!='pending'){
$to = $submission->response['email']; // You set your email here
$subject = 'Your order change to '. $submission->payment_status;
$message = 'Hi '.$submission->response['names']['first_name'].','.'<br>';
$message.='Your order change to '. $submission->payment_status;
}
return wp_mail( $to, $subject, $message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment