send_user_email and weblog entries
Posted: 04 February 2008 02:29 PM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

Love the Freeform.

Now I have an instance where I have a listing of events that users can register for. Clicking on the register link takes them to a Freeform. What I would like to do is after submitting, have a send user email generated that contains info from the event weblog they registered for.

Basically, I have an events template that has a contact form template embedded in it. The contact form template has the Freeform in it.  I can dynamically change the title of the form using a variable in the contact form embed:

{exp:weblog:entries weblog="events" dynamic="on" limit="1" url_title="{segment_4}" show_future_entries="yes" show_expired="no"}
 {embed
="embed/contact_form" form_title="{title}"}
{
/exp:weblog:entries}

Then in the Freeform tag:

{exp:freeform:form form_name="{embed:form_title} Registration Form" required="name|company|email|phone1"  template="registration_form"
send_user_email="yes" user_email_template="notification_template"}

My notification template looks like this:

Thank you for registering for XXXXXXXXX Registration Form
Below are the details of your registration.
Entry Date: XX XX XXXX

But if I try to assign any other variables from the weblog, all i get in the user email is the actual variable ie. {event_time} .

Hopefully I haven’t overlooked something simple. But I’ve been using Freeform for several sites and I’ve looked these forums over pretty good.
Any help is appreciated.
Thanks.

Profile
 
 
Posted: 04 February 2008 02:59 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3272
Joined  2006-10-18

What does your embedded template look like?

If you want to pass EE Weblog Entry Variables to Freeform Variables, you’ll need to do so with hidden inputs, etc.

For example:

<input name="freeform_field1" type="hidden" class="form" value="{eecustomfield1}" />
<
input name="freeform_field2" type="hidden" class="form" value="{eecustomfield2}" />
<
input name="freeform_field3" type="hidden" class="form" value="{eecustomfield3}" />

You can then use {freeform_field1}, {freeform_field2}, {freeform_field3} in a notification template, which would contain:
{eecustomfield1}, {eecustomfield2}, {eecustomfield3}

 Signature 
Profile
 
 
Posted: 04 February 2008 03:27 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

Cool, that seems to work. However, I have my weblog:entries tag outside of the embedded contact form template. So I have to assign variables and embed them in the hidden inputs. Tomorrow I’ll try putting the weblog tags around the Freeform tags directly and see if that clears up the embedding variables thing.

I’ll let you know how it works.
Thanks.

Profile
 
 
Posted: 05 February 2008 07:32 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

Problem solved. Thanks for the help, Pie Man!

If you wrap the Freeform form in the weblog:entries tag, you can do exactly as you state above. No assigning extra variables except creating the Freeform fields that link to the EE fields.

Thanks again.

Profile
 
 
Posted: 05 February 2008 08:43 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

Came across an issue with this. In one of my EE fields email addresses are entered. This causes the Freeform form to spit out a string of numbers. I tried doing several things such as changing the formatting of the field as well as just typing in the email address and also using the Email formatting button.

Any ideas?

Thanks.

Profile
 
 
Posted: 05 February 2008 09:17 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

I also found another issue. When using this format:

<input type="hidden" class="text_field" name="ee_event_text" value="{events_text}" />

If the event_text field in EE is set to XHTML format, the page won’t validate since it puts XHTML code into a value.

Profile
 
 
Posted: 06 February 2008 07:15 AM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3272
Joined  2006-10-18
gabe1k - 05 February 2008 08:43 AM

Came across an issue with this. In one of my EE fields email addresses are entered. This causes the Freeform form to spit out a string of numbers. I tried doing several things such as changing the formatting of the field as well as just typing in the email address and also using the Email formatting button.

Any ideas?

Thanks.

I’m not exactly sure I understand how you’re doing this… is this being done as an EE custom field with an email address in it, loaded into a Freeform custom field input? smile

I also found another issue. When using this format:

<input type="hidden" class="text_field" name="ee_event_text" value="{events_text}" />

If the event_text field in EE is set to XHTML format, the page won’t validate since it puts XHTML code into a value.

There’s probably not much you can do here… perhaps using the Find & Replace plugin?

 Signature 
Profile
 
 
Posted: 06 February 2008 07:46 AM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  6
Joined  2008-02-04

Thanks Pie Man,

Yes, for the email address issue, I have a custom EE field where the client enters an email address. I created a custom entry field for my Freeform template and linked the two fields in a hidden input in the form. But when you view the form online, the email address causes a bunch of numbers to display where the hidden field would be. And the email address doesn’t show up in the email notification that gets sent when you submit the form.

I would give you a link to see what’s going on, but the site is live, and as a temporary solution I just hard coded the email address into the notification template. That’s probably a good fix for this instance, since the email will always be the same for this site. But I thought it would be handy to see if there was a solution for future projects.

Also, in case I wasn’t exactly clear, the email address is part of a send to user email. The user registers for an event and gets an email that gives them the details of the event, including a contact person and contact email for the event. The event is a weblog entry. The email address is not part of the reply-to line, it’s part of the email body.

Thanks!

Profile
 
 
Posted: 06 February 2008 08:02 AM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3272
Joined  2006-10-18

Hmmmm, I’m not sure how you can disable email address encoding…

Although, in the future, we plan to release a version of Freeform that will include an option for Variable-Designated email address for Notification Parameters.

 Signature 
Profile