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',
),
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.
Answer
Yes You can fetch the email id on db then after set the here..
$obj->email='fethch the db email value';
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.