ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Blank Page when using weblog field in email contact form recipients parameter

April 01, 2009 2:58pm

Subscribe [3]
  • #1 / Apr 01, 2009 2:58pm

    bria2

    2 posts

    The following is a snippet of my template that has a contact form.  I’m want to pull an e-mail address from a weblog field.  If I hard-code the recipients parameter, the page works, if I use my weblog field variable, I get a completely blank page.  If I test with a dummy variable, like {segment_1}, the page loads OK.


    {exp:weblog:entries weblog="Projects" limit="1" url_title="{segment_1}” }

    {exp✉️contact_form user_recipients="false" recipients=”{project_email}” charset=“utf-8”}

  • #2 / Apr 01, 2009 4:01pm

    Ingmar

    29245 posts

    I am afraid it’s a parse order issue. If you have to use a custom field for the recipients parameter, try putting the whole tag in a sub-template, like so:

    {exp:weblog:entries ...}
       {embed includes/mail my_recipient="{project_email}"}
    {/exp:weblog:entries}

    In includes/mail you’d then have:

    {exp:email:contact_form recipients="{embed:my_recipient}" ...}

    Makes sense?

  • #3 / Apr 02, 2009 8:21am

    bria2

    2 posts

    Thanks.  That helps, and gives me the workaround that I was looking for.

    By the way, I think the blank page occurred because the e-mail was being formatted/encoded with JavaScript.  When I turned that off, I got the message that I have seen mentioned in these forums - something to the effect of an empty recipients field.

  • #4 / Apr 02, 2009 11:07am

    Sue Crocker

    26054 posts

    So is all well now, bria2?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases