Populate 'To' field of Mail section using shortcode
-
I have a website that features a number of different dealer pages, each contains a Contact Form 7 which I would like to automatically send submissions to the email address specifically for that dealer. The email address can be called dynamically and I can return it via a custom shortcode i.e. [dealer-email]. The problem I am trying to solve is to return this within the form. I have added the following filter to allow custom shortcodes to work within Contact Form 7:
function shortcodes_in_cf7( $form ) {
$form = do_shortcode( $form );
return $form;
}
add_filter( ‘wpcf7_form_elements’, ‘shortcodes_in_cf7’ );As the [dealer-email] shortcode simply results in producing an email address ie. ‘[email protected]’ I’m not sure why this doesn’t work when added to the ‘to’ field in the Mail section of the form?
Can anyone help?
Thank you.
- The topic ‘Populate 'To' field of Mail section using shortcode’ is closed to new replies.