Created
February 25, 2018 12:07
-
-
Save dhirenpatel22/788255a18c6d43e645e7abd0dd424b19 to your computer and use it in GitHub Desktop.
Attaching a PDF file in Contact Form 7 email notification
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 | |
/** | |
* Attaching a PDF file in Contact Form 7 email notification | |
* @author Dhiren Patel | |
* @link http://www.dhirenpatel.me/attach-pdf-file-in-cf7-email/ | |
*/ | |
add_filter( 'wpcf7_mail_components', 'mycustom_wpcf7_mail_components' ); | |
function mycustom_wpcf7_mail_components( $components ) { | |
$components['attachments'][] = get_template_directory().'/pdf/test.pdf'; // PDF Path | |
return $components; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment