Creating a "dynamic" subject line using info from the form
Here's one more "hijacking" example to end this chapter. ChronoForms gives you two choices for your e-mail subject — either a fixed phrase using the "subject" element in the Email Setup, or a value returned from the form using the "dynamic subject" element.
It's a frequent request to have a subject line that's a bit of each — a fixed text with a variable element. We can do this with another code snippet in the OnSubmit Before box.
Getting ready
We'll use the same form and alter the Admin Email Setup to include the value of the name field.
How to do it...
1. In the Form Editor go to the Email Setup by clicking on the Setup Emails tab and find the setup for the e-mail to the site administrator, delete the Subject element and drag in a Dynamic Subject instead.
2. Put
subject
(no quotes, no brackets) into the Dynamic Subject box, Enable the Email Setup, and Apply the changes in the Email Properties box.3. Go to the Form Code tab and open...