Created
February 28, 2018 09:47
-
-
Save New0/2e2226af9138c326427fab6bdfa3c0af to your computer and use it in GitHub Desktop.
Caldera Forms Paypal express process, send an email when a user cancels a Paypal express payment
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
<?php | |
add_action( 'caldera_forms_redirect_preprocess', function( $url, $form, $process_id ){ | |
//Change the Form ID | |
if( $form['ID'] === 'CF5a5e8452c6f82' ) { | |
//Set the recipient the sbuject and the message | |
$recipient = '[email protected]'; | |
$subject = 'My Email Subject'; | |
$message = 'My Email content'; | |
global $transdata; | |
$form['mailer']['recipients'] = $recipient; | |
$form['mailer']['email_subject'] = $subject; | |
$form['mailer']['email_message'] = $message; | |
if( $transdata['type'] === 'error' && $transdata['note'] === 'Transaction has been canceled' ) { | |
Caldera_Forms_Save_Final::do_mailer( $form, null, $transdata['data'] ); | |
} | |
} | |
}, 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment