I added a newsletter form on a CMS page and I created a new template to show the form. I was wondering if there is a way to display a custom success message for just that one form?
It seems I remember seeing a way by using javascript but I can't find it.
Best Answer
To do it clean, the success newsletter message is stored in newsletter controller :
Mage_Newsletter_SubscriberController
>newAction()
function >$session->addSuccess($this->__('Thank you for your subscription.'));
.So if you want to customize this message just for one form your have to this:
1) Rewrite the controller in your local, from :
app/code/core/Mage/Newsletter/controllers/SubscriberController.php
to your local codepool.2) Create a new function, you call it for example
customnewAction()
:3) Create your custom Newsletter template in :
app/design/frontend/{package}/{theme}/template/newsletter/custom_subscribe.phtml
then put inside the code bellow:4) If you want to display this new Newsletter form in your CMS page you have to put this code inside:
5) Clear your Magento cache and you'll get what you want.