1

we have a Contact Us form that is used for customer to enter questions/comments. Although the email is sent out there is no confirmation page that says something like "Your message has been sent". Is there anyway to add this?

thanks! Ahdee

1 Answer 1

1

Check there has any message object like this.

If not then added in your controller after sending message.

For success:

 $this->messageManager->addSuccess( __('Your message has been sent') ); 

For error:

 $this->messageManager->addError( __('We can\'t process your request right now. Sorry, that\'s all we know.') ); 
3
  • thank you. However, where can I find this controller file? I'm using the default contact us page I believe. Commented Sep 24, 2017 at 5:07
  • Actually, I located the file, ..vendor/magento/module-contact/Controller/Index/Post.php; its probably bad form to edit Magento's core files but I don't know how to redirect this. I found the addSuccess part however, strangely it is there; its just not showing up. So what I ended up doing was redirecting to a cms page and not only did it work but the green message field showed up this time. This was my one line of code a modified to, $this->_redirect('contactus'); Commented Sep 24, 2017 at 5:39
  • It's missing part in your theme. There must be missing message container. Commented Sep 24, 2017 at 5:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.