Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

UserForm to send out unique/dynamic email subjects?


Reply

4 Posts   1051 Views

Avatar
Mohammed

4 February 2011 at 4:56am Community Member, 25 Posts

We are using the UserForm module. Is there a way for the form e-mail subject to contain user submitted data? We need each e-mail that is submitted using an online form to contain a unique subject so the form response does not get incorrectly grouped. (When using Google's Gmail "Conversation View", emails of the same subject/topic are grouped together)

If someone know's of a workaround, please let us know. That would be awesome!

Avatar
Ryan M.

4 February 2011 at 1:39pm Community Member, 309 Posts

In code/UserDefinedForm.php, on line 592, edit this:

$email->setSubject($recipient->EmailSubject);

You could do something like this:

$email->setSubject($recipient->EmailSubject." - ".$submittedFields->find('Name', 'EditableTextField1')->Value);

In order to find the field you want to insert, you'll have to do this a few lines above:

print_r($submittedFields); die();

And do a test submit of your form to get the raw data and pick out the name of the field you want to use in the email subject.

Avatar
Mohammed

8 February 2011 at 9:36am Community Member, 25 Posts

I tried to make the changes you suggested, however, I was not able to get it to work...Do you have any other ideas? :-/

Avatar
Ryan M.

9 February 2011 at 12:18pm (Last edited: 9 February 2011 12:18pm), Community Member, 309 Posts

Well, why didn't it work? Paste your code here and let's see, and don't forget to mention which form field you are trying to use in the subject.