Skip to content

Instantly share code, notes, and snippets.

@mohsinrasool
mohsinrasool / VCF attachment in Contact Form 7
Created May 8, 2017 16:21
VCF attachment in Contact Form 7
/**
* Generate VCF from form's data and send as attachment for admin, in Contact Form 7
*
*/
add_action('wpcf7_before_send_mail', 'wpcf7_add_attachment');
function wpcf7_add_attachment($contact_form) {
global $_POST;
$submission = WPCF7_Submission::get_instance();
$vcf_dir = WP_CONTENT_DIR.'/uploads/2017/04/';