Practical Joomla!’s RSS Feeds

Changing the Mail Subject Line for JForms

An issue that had been bugging me for a while now was the fact that JForms, I guess the best form creation plugin around for Joomla!, sends out all mail messages sent through the forms with:

  • subject line 'New entry added' to the administrator (me)
  • subject line 'Your entry has been received' for the confirmation mail to the sender of the mail

There is no variable – yet – in the JForms interface to change that, and it looks quite unprofessional to the sender and is quite annoying for the admin when he or she runs multiple sites. The subject line should, in my humble opinion, at least give away the site name the mail is sent from, so the admin knows what action to take.

It took me some time, but I finally found the solution. It's requires going into a php file and changing stuff, but for most admins, that should not be a problem.

The solution

  • Fire up your favorite FTP application (I use CuteFTP) and go to your Joomla! installation folder
  • Go to folder /administrator/components/com_jforms/plugins/storage/Mail
  • Download file mail.php to your desktop
  • Make a security copy of the mail.php file, so you have a proper copy when things don't work out!
  • Use a text editor (Notepad), make sure you turn Word Wrap off, and open the mail.php file
  • Go to the following lines:

//$mail->setSender( array( $email, $name ) );
$mail->SetSubject(JText::_('New entry added'));
$mail->SetBody( $adminMessage );
$mail->Send();

  • Change the text 'New entry added' in line $mail->SetSubject(JText::_('New entry added')); to the subject you want to use for the administrator mail. Make sure you do not delete the start or end quotes!
  • Go to the following lines:

//$mail->setSender( array( $email, $name ) );
$mail->SetSubject(JText::_('Your entry has been received'));
$mail->SetBody($userMessage);
$mail->Send();

  • Change the text 'Your entry has been received' in line $mail->SetSubject(JText::_('Your entry has been received')); to the subject you want to use for the confirmation mail the sender receives. Again, make sure you do not delete the start or end quotes!
  • Save the mail.php file (WordWrap should be off, otherwise the file contents mash up!), open it again to ensure the file still looks good, and upload it to the folder you downloaded it from

This takes care of this tiny issue with JForms!

Bookmark and Share
_____________________________________________________________________________________________

Robin Roelofsen

"I think complexity is mostly sort of crummy stuff that is there because it's too expensive to change the interface."
Jaron Lanier

4 comments to Changing The Mail Subject Line For JForms

  • boundyNo Gravatar

    thank your for this invaluable and easy instruction!

  • RobinNo Gravatar

    Gladly done! Thanks for your comment!

  • elvisNo Gravatar

    Hi ,
    I don't have this folder structure and this file . I use Jform 0.7 and my folder structure is like this
    /administrator/components/com_jforms/views/form/tmpl
    So i am unable to change the subject for the emails that are sent . Please can you figure it out.
     
    Thanks
    Elvis

  • RobinNo Gravatar

    Mmm… so no plugins folder in /administrator/components/com_jforms/? Sorry, in that case I have no idea. I am running 0.7 RC1 as well, so there should be no problems.

    You may want to check out the JForms forum at this address.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">