Tag Info

Hot answers tagged

1

Your code works well when put in a page template, so what is currently wrong in your case most probably is the usage of the wrong hook in the wrong place. Just an example of how you can hook this: add_action('ahook', 'add_page_content_Send_Feed'); //add this after your function definition Then you can use this in any page or other template of the theme ...


1

You should take a look at wp_mail on the codex. This will do everything you need, and it's "the wordpress way". There are also particular controls for attachments. Basic usage is: <?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>


1

Try this instead. There was some internal restructuring in CF7 3.9. add_action('wpcf7_before_send_mail','send_pdf'); function send_pdf( $cf7 ) { $id = $cf7->id(); if ($id==741){ $submission = WPCF7_Submission::get_instance(); $submission->add_uploaded_file('pdf', get_template_directory().'/test.pdf'); } } This should ...



Only top voted, non community-wiki answers of a minimum length are eligible