Created
August 4, 2021 22:48
-
-
Save rafiahmedd/4f769b982f8429fc527f4f80e2372516 to your computer and use it in GitHub Desktop.
Trigger an email when payment status changed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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