• Hi, I have been trying to get this working but just can’t quite get it right.

    I have an acf email field I want to use as the Contact Form 7 email recipient in the To field.

    So far have set up a hidden field

    [dynamichidden recipient-email “CF7_get_custom_field key=’email’ obfuscate=’on'”]

    and then set the To field to
    [recipient-email]

    I then set up my acf field to link to the form in my php page

    <?php if( get_field(’email’) ): ?>
    <p><i class=”far fa-envelope”></i>
    <?php endif; ?>

    The form appears but it doesn’t validate. I get the message – There was an error trying to send your message. Please try again later.

    There is a syntax error with the shortcode in Contact 7 which I know people have asked about before but I understood it was a warning and would still send ok.

    What am I doing wrong.

    Also, I actually want this to work from a list of posts rather than the single post – will that work?

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Thread Starter fibiet

    (@fibiet)

    The code in my php page is `<?php if( get_field(’email’) ): ?>
    <p><a href=”https://www.mywebsite.org.uk/contact-form/&#8221; alt=”email this company” title=”email this company” ><i class=”far fa-envelope”></i></a>
    <?php endif; ?>`
    Hopefully the syntax will copy correctly this time

    • This reply was modified 5 years, 11 months ago by fibiet.
Viewing 1 replies (of 1 total)
  • The topic ‘Dynamic recipient email’ is closed to new replies.