Edit subject in mail sent from form
Permalink 1 user found helpful
How can I edit the text in mail subject sent from a concrete form?
I cant find it. Can you tell me the exact line number in concrete/blocks/form/controller.php?
Line 311.
$mh->setSubject($this->surveyName.' '.t('Form Submission') );
$mh->setSubject($this->surveyName.' '.t('Form Submission') );
thank you, line 327 in my controller.php
Hi, does anyone know where could I find this code in version 5.6.1.2?
concrete/blocks/form/controller.php now only has the following:
concrete/blocks/form/controller.php now only has the following:
I'm looking for the same thing in 5.6.1.2 as well... if you find it please post.
Thanks
Thanks
A couple of versions ago, the 'real' controllers were moved to [root]/concrete/core/controllers. The benefit of this is that you can now just override a single function rather than having to override the entire class. To override the form controller and change the 'Subject' text, take the attached file and rename it back to controller.php and put it in
[root]/blocks/form/controller.php
If you have a look in this file, you will see that it just contains the 'action_submit_form()' function and on line 216 you will see that I have added 'Test submission' to the subject.
Give it a whirl.
[root]/blocks/form/controller.php
If you have a look in this file, you will see that it just contains the 'action_submit_form()' function and on line 216 you will see that I have added 'Test submission' to the subject.
Give it a whirl.
Hi - thanks so much for answering!
If I want our subject line to just read "AVL Answers" - do I change everything between the quotes, or just where it reads Test Form Submission --
to
or
Sorry - I'm not exactly familiar with how the %s works - but if I delete it, I have to also delete something else that corresponds to it, right?
If I want our subject line to just read "AVL Answers" - do I change everything between the quotes, or just where it reads Test Form Submission --
$mh->setSubject(t('%s Test Form Submission', $this->surveyName));
to
$mh->setSubject(t('AVL Answers', $this->surveyName));
or
$mh->setSubject(t('%s AVL Answers', $this->surveyName));
Sorry - I'm not exactly familiar with how the %s works - but if I delete it, I have to also delete something else that corresponds to it, right?
%s is the name of the form so I wouldn't remove it or else every form on your site will have the same subject and you won't be able to tell which form is being returned. That's why the core 'subject' is so plain. It's trying to add a generic 'predicate' to the Subject line when it doesn't know the 'subject' of the sentence yet.
If the form called 'Contact' is being submitted, then the Subject will be 'Contact Form Submission'. If the form called 'AVL Answers' is being submitted, the Subject will be 'AVL Answers Form Submission'
If you look at the code, this line tells you how it works:
The %s is a placeholder and the value of $this->surveyName gets injected in place of the %s
Make sense?
If the form called 'Contact' is being submitted, then the Subject will be 'Contact Form Submission'. If the form called 'AVL Answers' is being submitted, the Subject will be 'AVL Answers Form Submission'
If you look at the code, this line tells you how it works:
$mh->setSubject(t('%s Form Submission', $this->surveyName));
The %s is a placeholder and the value of $this->surveyName gets injected in place of the %s
Make sense?
Ah, ok - That's about how I thought it worked. I'll have to think about the form names...
We only have one main form - the generic contact us form... I have a couple other forms that almost never get used, but they would be extremely easy to tell what form they are.
I'll have to think about how to go about this - what to name my forms and what to have as a global add-on to the form name. Thanks so much for your help!
We only have one main form - the generic contact us form... I have a couple other forms that almost never get used, but they would be extremely easy to tell what form they are.
I'll have to think about how to go about this - what to name my forms and what to have as a global add-on to the form name. Thanks so much for your help!
Thanks mhawke - this helped me a bunch as well.
In Forms - I'm also changing the Subject on the "guestbook.php"
The only other thing I'm looking for is where do I change the Reply to Email from "Concrete5-noreply" to something like "Mywebiste-noreply"
In Forms - I'm also changing the Subject on the "guestbook.php"
The only other thing I'm looking for is where do I change the Reply to Email from "Concrete5-noreply" to something like "Mywebiste-noreply"
Hi There
Is there any way of getting the name of the form user to appear in the subject title. Client of mine want it so she can quickly see who sent form.
many thanks for your help
Is there any way of getting the name of the form user to appear in the subject title. Client of mine want it so she can quickly see who sent form.
many thanks for your help
Probably best to copy the form block folder from /concrete/blocks to /blocks first before changing anything.
Not sure if there is an easier way?