Attaching a pdf to Contact Form 7 e-mail via functions.php [closed]

I’ve found what’s been missing in the code. You have to add this also: add_filter( ‘wpcf7_mail_components’, ‘mycustom_wpcf7_mail_components’ ); function mycustom_wpcf7_mail_components( $components ) { $components[‘attachments’][] = get_template_directory().’/pdf/test.pdf’; return $components; } Now everything is working fine and the file is attached to email without the need to add fields in the contact form.

Contact form sender email

Sending an email from an address you don’t own will mean you run into problems with countermeasures again email spoofing (e.g SPF), as you’re effectively impersonating the user’s email address to send your email. You could put the user email address as the name, but send the email from an address you own For contact … Read more

Add custom variable in Contact Form 7 mail body

You should do it like so: add_action( ‘wpcf7_init’, ‘custom_add_form_tag_my_source’ ); function custom_add_form_tag_my_source() { // “my-source” is the type of the form-tag wpcf7_add_form_tag( ‘my-source’, ‘custom_my_source_form_tag_handler’ ); } function custom_my_source_form_tag_handler( $tag ) { return isset( $_COOKIE[‘my_source’] ) ? $_COOKIE[‘my_source’] : ”; } See the documentation for more details. Or you can also try this, to parse regular … Read more

How to set Contact Form 7 fields default value using shortcode attribute? [closed]

the destination-email attribute requires an additional filter to be hooked to work, as detailed in cf7 doc and this forum thread, you need to ensure you do the following 4 steps: 1) in addition to the short code attribute, [contact-form-7 id=”123″ title=”Contact Form” destination-email=”[email protected]”] 2) you need to, add_filter( ‘shortcode_atts_wpcf7’, ‘custom_shortcode_atts_wpcf7_filter’, 10, 3 ); function … Read more

get values from contact form 7 wp plugin [closed]

First change the `on_sent_ok’ to: on_sent_ok: ‘my_redirect();’ then create that my_redirect() function in the page that displays the form: <script> function my_redirect() { var price = document.getElementById(‘PRICE_FIELD’).value; var url=”https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_xclick&[email protected]&currency_code=USD&amount=”+price+’&return=http://http://cratecreative.com/norpac&item_name=contribution’; window.location = url; } </script and done! Just make sure that you correct the email in that url and replace PRICE_FIELD with the actual id of … Read more