emailtemplate

create the email template
3 followers

Hi Friends,

I will create the Email template extesnion look like this

so You can call to this extension using below code.

<?php
Yii::import('application.extensions.EMailTemplate.*');
$options=array();
 
$obj= new EMailTemplate();
$obj->site_url='www.demo.com';
$obj->subject='Subject:Mail Template';
$obj->header_image = '<img height="76px" width="567px" src="'.Yii::app()->getBaseUrl(true) . "/images/header.png".'">';
$obj->firstname='Maggie';
$obj->lastname='Q';
$obj->content='Lorum ipsum.........';
$obj->thanks_text='Thanks..<br>Maggie Q';
$obj->footer='Need Help? Have Feedback? Feel Free to Contact';
 
$obj->email='amodi06@gmail.com';
$obj->add_bcc ='amodi06@gmail.com';
 
 
$view = $obj->PassParameterOptions($options);
print Yii::app()->EMailTemplate->returnSomething($view);
die;
?>

Install Extesion

1)First You can downloaded the JPHPMailer extesion using this link http://www.yiiframework.com/extension/phpmailer/

and put your extesion in protocted/extersion directory

and also downloaded this EmailTemplate and put the same directory.

2)Open EMailTemplate.php you can set the Email Configuration on actionMailSend Function

3)Finally you may install this extesion on protocted/config/main.php

'components'=>array(
                'EMailTemplate'=>array(
                     'class'=>'application.extensions.EMailTemplate.EMailTemplate',
                ),
),

or

'import'=>array(
        'application.extensions.EMailTemplate.EMailTemplate',   
),

Total 2 comments

#16639 report it
Ankit Modi at 2014/03/13 11:38pm
Answer

Yes You can fetch the email id on db then after set the here..

$obj->email='fethch the db email value';

#16636 report it
Selvakumar at 2014/03/13 01:19pm
Send to more than one mail from database.

Is this extension is used to send more than one email and the email id have to fetch from the database? I want to mail the peoples who are all registered in the site. Have to fetch the to mail id from database.

Leave a comment

Please to leave your comment.

Create extension