Forums

Dynamic from email and from name based on inputs in form

minijus 31 Dec, 2008
Hello,
I am new on this forum, but I expect you to help me. I would like to make dynamic from email . For example I have simple question form (name, email and your question). When it is submitted I receive email and when I want to respond there is always the same email ( which I have set ), but I would like that there would be users email (which he has entered in form).

Minijus
GreyHead 31 Dec, 2008
Hi minijus,

In the 'SetUp Emails' Tab for your form drag a 'Dynamic To ' box into the email and put the email field name in it.

Bob
minijus 31 Dec, 2008
Thank you a lot. I have found it on my own. But thanks anyway.

Now I have bigger problem... I would like that on mail which is sent automatically after form submitting php script would execute, for example <?php echo date('Y-m-d');?> . I have order form and I need order number to add to, and this can't be done without enabled PHP in e-mail... Any ideas ?

Maybe I had to make new thread... I am not sure about that.
GreyHead 31 Dec, 2008
Hi Minijus,

You can put PHP into the email template. You may need to turn off the HTML Editor first - the setting for that is on the Properties tab for the Email.

Bob
minijus 31 Dec, 2008
Well I need html in mail, cause I am sending order information in tables. But I found solution🙂 simply add hidden fields which value is php script that in email template you simply add {name_of_hidden_field}. This works perfect🙂 Of course this method will not work if you want to work with submitted information.
GreyHead 31 Dec, 2008
Hi minijus,

Yes, that will work well.

BTW Turning off the HTML editor has *nothing* to do with using HTML in your email. It just stops the WYSIWYG editor messing up your php.

Bob
prdg1 01 Jan, 2009
I have version 2.5 J1.5 RC3.1 and obviously don't have this tab so I assume I need to upgrade to ChronoForms V3.0 Stable.zip. I've tried updating to this one but it doesn't work. Any ideas?
GreyHead 01 Jan, 2009
Hi prdg1,

In ChronoForms 2.5 you can put PHP directly in the Email template box. CF 3.0 uses a WYSIWYG editor for the Email template and this can do strage things when you try to enter code.

There is no automatic upgrade from CF 2.5 to CF 3. Backup your database if you have any form data stored; take BackUp copies of each of your forms; uninstall 2.5; install 3.0 then recreate your forms by copying the key data from the .cfbak file into the corresponding text box.

Bob
prdg1 01 Jan, 2009
Thanks for letting me know but here is what I'm trying to figure out: When on the general tab, there is an option of "From Email" in general, shouldn't that be the email address of the person who is completing the form? That way, when it's received, all we have to do is hit "reply". How would I tell that field to pull the "email" from the form? Or is what you are saying is to ignore this page and actually insert php into the "form code" tab under "On Submit code - before sending email"

Thanks again
GreyHead 01 Jan, 2009
Hi prdg1,

In CF 2.5 you can only put email addresses in the Email boxes on the General Tab. You can put field names in the Special Fields tab if you want to set dynamic values*.

I *do not* recommend using the submitter's address in the From or Reply To Emails. Technically the email isn't from them, it's from the site; and more importantly some ISP check these and will drop the email if the domain name is not one they recognise (you may get a realying not allowed message if you are lucky).

That said you are welcome to try and see if it will work on your setup.

My recommended route for easy replying is to add a Reply link in the Email template using a mailto: url.

Bob

* Note that there is a bug in the validation that will not allow an empty field for the To address in the General Tab, you need to put at least a dummy address in there and delete it in the OnSubmit Before box.
GreyHead 24 Jun, 2010
Hi XenEffect,

Please remove the {} brackets - they are not required.

I strongly recommend that you don't use the Dynamic From Email as it can cause probles with email delivery. Instead use the plain From Email (and From Name) plus the Dynamic ReplyTo Email & Name.

Bob
This topic is locked and no more replies can be posted.