Last active
June 23, 2017 19:49
-
-
Save Shelob9/6a4fdbb9a4cb8335d356dbf9836045fc to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Use a custom HTML file for your Caldera Forms email. | |
*/ | |
add_filter( 'caldera_forms_mailer', function ( $mail, $data, $form ) { | |
//MAKE SURE TO CHANGE FORM ID | |
if ( 'CF1243..' == $form[ 'ID' ] ) { | |
ob_start(); | |
//MAKE SURE TO CHANGE THIS TO YOUR FILE PATH | |
//BTW - You have all submission data in $data if you want to use in your html file | |
include '/path_to_file.html'; | |
$html = ob_get_clean(); | |
//Optional - Substitute Caldera Forms magic tags. | |
$html = Caldera_Forms::do_magic_tags( $html ); | |
$mail[ 'message' ] = $html; | |
} | |
return $mail; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment