1

I have a channel called Jobs. When admin posts a new entry, they are presented with a field called email_recipient in which they can type an email address of their choice.

Then...on the template which contains the Freeform code. I would like to use the data in the email_recipient field to be used in the admin_notify parameter on Freeform. However, so far I have had no joy and wondered if this was even possible or will Freeform not allow this

Can anyone help me out with this?

My code is

{exp:channel:entries 
channel="jobs" 
dynamic="on" status="Open"
disable="categories|category_fields|member_data|pagination"}

<h3>Job Application Form</h3>

{exp:freeform:form 
form_name="job_application" 
return="/contact/thanks" 
form:class="form-horizontal contact-form" 
form:id="job_application"
recipients="yes" 
recipient1="{recipient_email}"}

<!--Form Data-->

{/exp:freeform:form}
{/exp:channel:entries}

Note that the above example is using recipients="yes" and reciepient1=. I have tried with admin_notify too with no difference

6
  • So you are trying to say that after put the code recipient1="{recipient_email}" It still not send email to that recipient? Commented Apr 11, 2017 at 14:33
  • Thats right. I have used a couple of emails to test but nothing has popped up in my inbox. The addresses are certainly correct so it has me a little baffled
    – Adam
    Commented Apr 11, 2017 at 14:36
  • Remove recipients="yes" recipient1="{recipient_email}"} and put admin_notify="[your email address]". Put email hardcoded and test if you still not receive emails ? Commented Apr 11, 2017 at 14:40
  • 1
    under your {exp:channel:entries} pass parameter parse="inward" and mail will sent to {recipient_email} address :) Commented Apr 11, 2017 at 14:54
  • 1
    Ah, of course. Thank you. It's just been sent using the custom field. Thanks a lot. Much appreciated.
    – Adam
    Commented Apr 11, 2017 at 15:01

1 Answer 1

0

Well, Notifying parameter is working fine with Freeform. Issue is of parsing.

When we pass a EE loop under other EE loop, It will parse by priorities. In that case naturally Module tag will parse first and channel entries tag will parse after. You just need to tell {exp:channel:entries} to parse the loop first so your variable {recipient_email} will be available to use in Freeform.

Please add parse="inward" parameter to your {exp:channel:entries} loop and give it a try. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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