Wednesday , 26 July 2017
Home » Magento » [Magento] Change Default Newsletter template in Magento
[Magento] Change Default Newsletter template in Magento

[Magento] Change Default Newsletter template in Magento

Hi Friends,

I am working with Magento Open source shopping cart where I am implementing Newsletter feature for my client. I need to set up almost 20 newsletter templates and most of them are similar. To do so, I need to add newsletter template first. You can add newsletter template using below path.

Add New Template Path

Newsletter > Newsletter Templates > Add new template

Default Content of Add New Template

When you click on Add new template, it will open page with below content in content editor.

Follow this link to unsubscribe

{{var subscriber.getUnsubscriptionLink()}}

This is default content and coming from some pre defined page. I want to change this default content of Add new template page. so whenever i will click on add new template, it will show me default content which i will set. This makes my life and client’s life easy by making few changes to get to final template instead of copy and paste original template.

Core File needs to be edited

To make change in default content of add new template page, you can go to below file.

\app\code\core\Mage\Newsletter\Model\Template.php

Find function “getTemplateText” which have the default content code. Make changes here and it will affect to add new template page.

public function getTemplateText()
{
 if (!$this->getData('template_text') && !$this->getId()) {
 $this->setData('template_text',
 Mage::helper('newsletter')->__('Follow this link to unsubscribe <!-- This tag is for unsubscribe link --><a href="{{var subscriber.getUnsubscriptionLink()}}">{{var subscriber.getUnsubscriptionLink()}}</a>')
 );
 }

 return $this->getData('template_text');
}

Are you looking to Change Default Newsletter template in Magento ? If yes, i hope you got the solution. If so, please share to your social network and help them to know the same and save time.

      
Plugin by: PHP Freelancer

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel working as PHP Programmer India. I have developed this site to share my knowledge, thoughts and experience during the development of projects. We are group of developers working together. If you want to hire us for any PHP related work, you can reach me via Email, Phone or Chat.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.