0

I'm using contact form 7 and ACF field.

In ACF i created an email field : "email".

In my contact form 7 i have a field called destination-email : [email* destination-email id:exp-email default:shortcode_attr ]

In my template file i have a line :

<?php echo do_shortcode( '[contact-form-7 id="983" title="Formulaire de contact 1" destination-email="test@example.com"]' ); ?>

I need to replace test@example.com with the value of ACF email.

How can i do it ?

Thanks in advance for your help !

1

You can use php values inside the do_shortcode function In your case it will be like this:

<?php echo do_shortcode( '[contact-form-7 id="983" title="Formulaire de contact 1" destination-email="'.get_field( 'email' ).'"]' ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.