Send text version of confirmation email

[[MAILPOET-1966]
This commit is contained in:
Pavel Dohnal
2019-04-10 08:15:41 +02:00
committed by M. Shull
parent 4e5ee4f2a6
commit e8a2b970df

View File

@@ -2,6 +2,7 @@
namespace MailPoet\Subscribers; namespace MailPoet\Subscribers;
use Html2Text\Html2Text;
use MailPoet\Mailer\Mailer; use MailPoet\Mailer\Mailer;
use MailPoet\Models\Subscriber; use MailPoet\Models\Subscriber;
use MailPoet\Settings\SettingsController; use MailPoet\Settings\SettingsController;
@@ -72,13 +73,16 @@ class ConfirmationEmailMailer {
'activation_link' 'activation_link'
); );
//create a text version. @ is important here, Html2Text throws warnings
$text = @Html2Text::convert((mb_detect_encoding($body, 'UTF-8', true)) ? $body : utf8_encode($body));
// build email data // build email data
$email = array( $email = array(
'subject' => $signup_confirmation['subject'], 'subject' => $signup_confirmation['subject'],
'body' => array( 'body' => [
'html' => $body, 'html' => $body,
'text' => $body 'text' => $text,
) ]
); );
// set from // set from