1

This is a follow-up to my previous question

I’m trying to send the output of a particular form to two emails: one, a generic alias that is hardcoded in; and the other, the individual originator's email which is listed in the individual channel entry. When I test the form, I receive notification at the hardcoded email address, but not at the individual entry/originator address. I’ve tried this with the hardcoded email in first position, and in second position; and I still get the same results.

The channel name is “originators”. The field name is “originator_email”.

The URL is http://dev.soundmtg.com/originator/lesli-schauf (the site’s index.php is hidden from the URLs, so originator is the template group, and this uses the index template in that group.) In the entry, the originator_email is leslis@fairplay.com.

ExpressionEngine 2.5.3 Freeform 4.0.8

Here’s the code that I’m using:

{exp:channel:entries channel="originators" 
disable="member_data|categories|member_data|pagination" dynamic="no" limit="1"}

<h1 class="form_title">Quick Quote</h1>

{exp:freeform:form 
    form_name="quick_quote" 
    return="thanks" 
    admin_notify="lesli.schauf@gmail.com|{originator_email}" 
    recipient_user_template="quick_quote" 
    required="first_name|email_address" 
    form:id="quote_form" 
    admin_notification_template="quick_quote_notification"
}

<fieldset class="quote_main">
    <fieldset class="left">
        <label for="first_name"><span class="form_star">*</span>First Name</label>
        <input type="text" name="first_name" id="first_name"/>
        <label for="last_name"><span class="form_star">*</span>Last Name</label>
        <input type="text" name="last_name" id="last_name"/>
        </fieldset>
        <fieldset class="left">
        <label for="email_address"><span class="form_star">*</span>Email Address</label>
        <input type="text" name="email_address" id="email_address"/>
        <label for="phone_number"><span class="form_star">*</span>Phone Number</label>
        <input type="text" name="phone_number"/>
    </fieldset>
    <input type="submit" id="form_button" value="Quote Me" title="Quote Me" />
    <input type="button" id="form_button" class="cancel" value="Cancel" title="Cancel">
</fieldset>
{/exp:freeform:form}

{/exp:channel:entries}

(Many of the form fields and much of the structural HTML removed from the code snippet above because they work fine - it’s the multi-email notification that isn’t working as expected.)

I expect this to record the form entry in the Freeform console, and to send an email to lesli.schauf@gmail.com, and to also send an email to leslis@fairplay.com. But no matter whether I list the hardcoded email first in the sequence, or second, I see the form entry in the Freeform console and receive an email at lesli.schauf@gmail.com but get nothing at leslis@fairplay.com.

Any suggestions on what I might be doing wrong?

EDIT: I first tried using embedded variables, but that wasn't working either. Here's that syntax:

First, from the template:

{exp:channel:entries channel="originators" disable="member_data|categories|member_data|pagination" dynamic="no" url_title="{segment_2}" limit="1"}
{embed="includes/quick-quote" email_addresses="lesli.schauf@gmail.com|{originator_email}"}
{/exp:channel:entries}

And then the Freeform tag from the embedded quick-quote template:

{exp:freeform:form 
    form_name="quick_quote" 
    return="thanks" 
    admin_notify="{embed:email_addresses}" 
    recipient_user_template="quick_quote" 
    required="first_name|email_address" 
    form:id="quote_form" 
    admin_notification_template="quick_quote_notification"
}
1

Since Freeform and Channel are both modules, and parsed at the same stage, it may be the {originator_email} custom field is not yet parsed by the Channel module. If so you won't be able to use this as a parameter on the Freeform tag. It may be easiest to work around this by passing that variable to an embed containing your Freeform tags.

If the embed doesn't seem to be doing the job even after you confirm that your embed variable is passed correctly, then the other thing to check is the spam folder for the account where you aren't seeing the email show up.

| improve this answer | |
  • Hmm, I would expect that to work. Did you double check that your email_addresses embed variable showed up correctly in your embed by echoing it back out in the template where you could see it? Simple troubleshooting step, but worth a try just to confirm . – Alex Kendrick Jan 31 '13 at 21:22
  • How do I echo that back / display that in the template, pls? I can give that a shot, just to make sure that it's actually picking up the email_addresses bit in the first place; but I'm not 100% sure now to do that. – user800 Jan 31 '13 at 21:25
  • At the top of your embedded template just put something like <h1>The embed variable contains: {embed:email_addresses}</h1> – Alex Kendrick Jan 31 '13 at 21:28
  • The other thing to double check is the spam folder for the account where you aren't seeing the email show up. – Alex Kendrick Jan 31 '13 at 21:41
  • It looks like you have a syntax error on your embed (missing close quote) but let us continue this discussion in chat – Alex Kendrick Jan 31 '13 at 21:46

Your Answer

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