Forums

Email sending - form fields in subject line

momentis 17 Jan, 2012
Good morning (afternoon?)!!

Is there any way to include form information (dynamic) in the subject line of emails generated by CF?

For example, I have a form where a person includes their first and last name. I would like the confirmation email to say:

Confirmed - Rick Stofiere

Is that possible with CF?

I have tried to include the field names in Dynamic Subject, but the email generated just shows DEFAULT SUBJECT.

Thanks!!!
Rick
GreyHead 17 Jan, 2012
Hi Rick,

Use a Custom Code action to build the subject lien you want and add it to the Form Data array.
<?php
$form_data['subject'] = 'Confirmed - '.$form->data['first_name'].' '.$form->data['last_name'];
?.
The put subject in the Dynamic Subject box.

Bob

PS You could also try my Email [GH] action which allows {input_name} in the subject box.
momentis 18 Jan, 2012
Thanks for the reply Bob!! Now, two questions (please forgive me in advance for being so obtuse!):

1) Where is the Form Data array?
2) How do I find the Email [GH] action?

Thanks!!!
Rick
GreyHead 18 Jan, 2012
Hi Rick,

You can access the $form->data array from PHP in a Custom Code action.

My actions are here

Bob
momentis 18 Jan, 2012
Thanks Bob! Enjoy the beer I sent your way!

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