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

Userforms: set the subject


Reply

8 Posts   973 Views

Avatar
Big Bang Creative

10 June 2009 at 10:44pm Community Member, 92 Posts

Currently the subject of the email I get is "Contact Form" which is the page name.

I can see in SubmittedFormEmail.ss <h1>$Subject</h1> which I can change for the body of the email but what about the actual subject of the email? it would be good if I could change this in the CMS, can this be done?

Avatar
baba-papa

11 June 2009 at 7:56pm Community Member, 279 Posts

You need to change the php-code. There is no way to change the email´s title in the cms.

Avatar
Willr

11 June 2009 at 8:00pm Forum Moderator, 5511 Posts

If you use the recently released 0.2 version of user forms then you can customize the subject heading in the cms.

Avatar
Big Bang Creative

11 June 2009 at 8:04pm Community Member, 92 Posts

I'm running v2.3.1 though :-( and cannot upgrade.

How can I hard code this?

Avatar
baba-papa

13 June 2009 at 12:30am Community Member, 279 Posts

In UserDefinedForm.php you have the following lines:

if( $this->EmailOnSubmit ) {
         $email = new UserDefinedForm_SubmittedFormEmail($submittedFields);         
         $email->populateTemplate($emailData);
         $email->setTo( $this->EmailTo );
         $email->setSubject( $this->Title );


Change

$this->Title

to the string you want to have as subject of the email. Do the same some lines below for the $emailToSubmiter object. That´s it.

Avatar
Big Bang Creative

16 June 2009 at 8:11pm Community Member, 92 Posts

I have already figured that out, but I'd really like this to be set in the CMS for each userform. It's no good setting the subject to lets say "Contact Form Submission" when I have another form which is not a contact form.

Avatar
baba-papa

16 June 2009 at 11:00pm Community Member, 279 Posts

Then you should upgrade or implement that function by youself.

Avatar
Big Bang Creative

17 June 2009 at 8:28pm Community Member, 92 Posts

For those that do not know v0.2 of user forms will let you dynamically set the subject, from address, to address all from the CMS.

However User Forms v.0.2 requires SS 2.3.2 beta, which has not yet been released as a stable version. It will NOT work with the current release (v.2.3.1).