Knowledge Craving
Knowledge Craving

Reputation: 7993

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.

Upvotes: 3

Views: 2797

Answers (1)

Gaurav
Gaurav

Reputation: 28755

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.

Upvotes: 6

Related Questions