vernes / YiiMailer

Yii extension for sending emails with layouts using PHPMailer
81 stars 38 forks source link

Add logic to set the alt body from a view file #27

Closed bopinto closed 8 years ago

bopinto commented 8 years ago

PHPMailer already strips the HTML body to set the alt body, but we may want to set it on our own.

surfer190 commented 8 years ago

I opened an issue #28. Why is the html automatically converted...thats annoying. What about links, jut showing their text and not the url.

And setting $mail->altBody('Hello world');

vernes commented 8 years ago

Merged, thanks

surfer190 commented 8 years ago

@vernes @bopinto I noticed that setting an altBodywith something like:

$mail->altBody('Hello world');

doesn't matter as this value is overwritten no matter what. I think the issue is in PHPMailer: the msgHTML function. The function docs says it:

Overwrites any existing values in $this->Body and $this->AltBody
vernes commented 8 years ago

Yes https://github.com/PHPMailer/PHPMailer/blob/master/class.phpmailer.php#L3335-L3339

But using textView from this PR you can overide it after it renders html body