The contact form 7 plugin provides an option to set the default value of a form field using a shortcode attribute (as documented here). This can be useful to dynamically change the recipient of a notification email using say a
destination-email field tag in a form and use a shortcode attribute to set its default value dynamically from within a page template using the
do_shortcode function. So for example, the following shortcode would send the email to firstname.lastname@example.org by default,
[contact-form-7 id="123" title="Contact Form" destination-email="email@example.com"]
However, it is not clear how to get it to work.
I already read other post where they were asking the same:
I must say that the solution didn't work for me. The contact-form keeps sending the emails to the email address set on Contact Form 7 configuration.
This is what i put on my single.php file:
<?php echo do_shortcode( '[contact-form-7 id="5" title="Form World Unite" destination-email="'.get_field( 'email' ).'"]' ); ?>
What could be wrong?