Dynamically send pdf attached to mail
-
Hi,
i’m trying to automatically add attachment with this code:add_action(‘wpcf7_before_send_mail’, ‘send_pdf’);
function send_pdf() {
$submission = WPCF7_Submission::get_instance();
$submission->add_uploaded_file(‘pdf_file’, get_template_directory().’/test.pdf’);
}I added in file attachments field this: [pdf_file] and also i added this in form: [file pdf_file filetypes:pdf limit:2mb] – this code is probably unnecessary.
And no attachment is sent. What i’m missing ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Dynamically send pdf attached to mail’ is closed to new replies.