Mail ¶
Small component for sending emails. Allows you to define multiple views, which may receive specific parameters to be used in it. Allows sending to multiple recipients.
Requirements ¶
Yii 1.x
Usage ¶
1) Extract content in your extensions directory
2) Configure the parameters according to your server and SMTP account parameters in "function init()" of Mail.php.
public function init() {
$this->mail = new PHPMailer();
$this->mail->Host = 'example.com';
$this->mail->Username = 'email@example.com';
$this->mail->Password = 'password';
$this->mail->Mailer = 'smtp';
$this->mail->Port = 465;
$this->mail->SMTPAuth = true;
$this->mail->SMTPSecure = 'ssl';
$this->mail->CharSet = 'utf-8';
$this->mail->ContentType = 'text/html';
}
3) Call the widget
<?php Yii::app()->controller->widget('ext.easy-mail.Mail',
array(
'view' => 'testView',
'params' => array(
'to' => array(
'email@example.com' => 'Name'
),
'content' => array(
'param1' => 'Value1',
'paramN' => 'ValueN'
),
'subject' => 'Subject of email'
)
)); ?>
Important notes: ¶
Variables can be used in templates using the following convention $params['content']['param1']
Fill
Hi,
How i Can fill value in controller???
Request use vars
You can use the vars of the form:
...
'content' => array(
'static' => 'for var static',
'dinamic' => $forDinamicVars
),
...
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.