Contact form: how to insert a prefix in the subject?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Cutter

Contact form: how to insert a prefix in the subject?

Post by Cutter »

Hello!

I'm using the contact_form plugin which is great. I managed to translate it in French. But I didn't find out how to add a prefix to the subject of a message. I know there is a way to display a default subject which can be modified by the user, but what I want is that the prefix doesn't show up to the visitor. I want to know when an e-mail is arriving from this contact form, so I thought about the output subject to look like this: "[From the website contact form] (Some user-chosen subject)".

Please help.
Thanks.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Contact form: how to insert a prefix in the subject?

Post by Dee »

On line 91 of plugins/function.contact_form.php add the prefix when sending the mail. Change:

Code: Select all

		elseif (@mail($to, $subject, $message, $extra)) {
to:

Code: Select all

		elseif (@mail($to, '[From the website contact form] ' . $subject, $message, $extra)) {
Regards,
D
Cutter

Re: Contact form: how to insert a prefix in the subject?

Post by Cutter »

Thanks! :D
Locked

Return to “CMSMS Core”