Last active
June 18, 2024 16:00
-
-
Save snrjosh/4969a813acd35e316871ff3f53cab84c to your computer and use it in GitHub Desktop.
Confirmation message
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 | |
function wpf_dev_frontend_confirmation_message( $message, $form_data, $fields, $entry_id ) { | |
// Only run on my form with ID = 924 | |
if ( absint( $form_data[ 'id' ] ) !== 924 ) { | |
return $message; | |
} | |
// Email form field - ID #1 | |
$email_for_order_delivery = $fields[ '1' ][ 'value' ]; | |
// Name form field - ID #0 | |
$drivers_licence_number = $fields[ '0' ][ 'value' ]; | |
// Add the name to the message | |
$message = '<p>Thank you. To complete your order please send $48 via Interac to <a href="mailto:[email protected]">[email protected]</a></p>. | |
<ul> | |
<li><strong>E-mail</strong>:' . $email_for_order_delivery . '</li> | |
<li><strong>DL#</strong>:' . $drivers_licence_number . '</li> | |
</ul> | |
<p>Please check your email for accuracy and contact us at <a href="mailto:[email protected]">[email protected]</a> if incorrect</p>.'; | |
return $message; | |
} | |
add_filter( 'wpforms_frontend_confirmation_message', 'wpf_dev_frontend_confirmation_message', 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment