Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla v1.6 - How & Where to set Custom Success Messages in Controller?

In Joomla! 1.6 Contact Form submission, I want to set a custom successful message, so that the front-end user can view that message after he submits the contact form.

There are 2 problems basically:-

  1. I am using the default Contact Form component (com_contact), as provided by the Joomla! v1.6. But I am unable to find the proper area from where the contact form is submitted & the mail is being sent. So I need to know the page name & the method name of this component, firing the mail from the front-end.
  2. How to set the custom messages (just like in the administrator panel) in the particular method of contact form component, to let the front-end user know that he has been able to successfully send the mail to the concerned staff?

Thanks in advance to all who can help.

like image 907
Knowledge Craving Avatar asked Dec 09 '25 22:12

Knowledge Craving


1 Answers

To show Message

use $this->setMessage(JText::_('COM_YOURCOMPONENT_MESSAGE')); if you are in controller.

or use

JFactory::getApplication()->enqueueMessage(JText::_('COM_YOURCOMPONENT_MESSAGE'));

And Email is sent through JoomlaRoot / components / com_contact / controllers / contact.php

find the function submit(), the mailing code is written here.

like image 146
Gaurav Avatar answered Dec 12 '25 15:12

Gaurav