VCF as attachment
-
Hi,
I created this function to add a vcf to an email. It works if I try with a png file. But it is not working with vcf and I can’t figure out why. Do you have any idea ? I’m 100% sure the file is in the folder, I can access it with other functions.add_filter('acfe/form/submit/email_args/action=mail-prospect', 'user_vcf', 10, 3); function user_vcf($args, $form, $action) { $ecard_id = get_the_ID(); $random_slug = get_field('random_slug', $ecard_id); $sourceFilePath = trailingslashit(ABSPATH) . '/f/contact/' . $random_slug . '/' . $random_slug . '.vcf'; $destinationFilePath = trailingslashit(ABSPATH) . '/f/prospects/' . $random_slug . '.vcf'; // Copy the file if (copy($sourceFilePath, $destinationFilePath)) { //WORKS $args['attachments'] = array(trailingslashit(ABSPATH) . '/f/prospects/logo-ecard.png'); //DO NOT WORK $args['attachments'] = array(trailingslashit(ABSPATH) . '/f/prospects/cmdjqi.vcf'); $args['attachments'] = array($destinationFilePath); //WORKS unlink($destinationFilePath); } return $args; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘VCF as attachment’ is closed to new replies.