Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for another Mail parse #250

Closed
tarranjones opened this issue Jul 26, 2018 · 2 comments
Closed

Add support for another Mail parse #250

tarranjones opened this issue Jul 26, 2018 · 2 comments

Comments

@tarranjones
Copy link

modify bedezign\yii2-audit\src\views\mail\view-html.php to support a mail parser which does not rely on the "php-mailparse" php extension.

if (class_exists('\PhpMimeMailParser\Parser')) {
    $parser = new \PhpMimeMailParser\Parser();
    $parser->setText($model->data);
    echo $parser->getMessageBody('htmlEmbedded');
} else if (class_exists('\ZBateson\MailMimeParser\MailMimeParser')) {
    $parser = new \ZBateson\MailMimeParser\MailMimeParser();
    $message = $parser->parse($model->data);
    echo $message->getHtmlContent();
} else {
    echo Html::tag('pre', $model->data) . Html::tag('br') . 'Please install php-mime-mail-parser for better functionality';
// or zbateson/mail-mime-parser
}
@Blizzke
Copy link
Member

Blizzke commented Nov 1, 2019

I'll look into providing functionality to somehow register a callback to do your own custom rendering. We can't be expected to provide support for any email renderer out there. I hope you understand that.

@Blizzke
Copy link
Member

Blizzke commented Nov 1, 2019

1.1.2 allows you to add a panel function called "renderEmail". If you do that, the control of outputting the mail will be passed on to your function. Haven't been able to properly test this, but hopefully this works. The documentation was updated to reflect this change. Closing this for now, feel free to open this again if there are issues.

@Blizzke Blizzke closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants