diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 4c490c92e2..5aa12323bb 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -60,7 +60,7 @@ class TemplateEmail extends Mailable ); $this->build_email->setBody( - TemplateEngine::wrapElementsIntoTables('
', $this->build_email->getBody()) + TemplateEngine::wrapElementsIntoTables('', $this->build_email->getBody()) ); $settings = $this->client->getMergedSettings(); diff --git a/app/Utils/TemplateEngine.php b/app/Utils/TemplateEngine.php index e4add15e57..858d22046d 100644 --- a/app/Utils/TemplateEngine.php +++ b/app/Utils/TemplateEngine.php @@ -259,7 +259,13 @@ class TemplateEngine $documents['wrapper'] = new \DOMDocument(); $documents['wrapper']->loadHTML($wrapper); - $styles = $documents['wrapper']->getElementsByTagName('style')->item(0)->nodeValue; + $documents['master'] = new \DOMDocument(); + + $documents['master']->loadHTML( + view('email.template.master', ['header' => '', 'slot' => ''])->render() + ); + + $styles = $documents['master']->getElementsByTagName('style')->item(0)->nodeValue; $documents['wrapper']->saveHTML(); diff --git a/resources/views/email/template/master.blade.php b/resources/views/email/template/master.blade.php index 09fc5069f0..3bd5032170 100644 --- a/resources/views/email/template/master.blade.php +++ b/resources/views/email/template/master.blade.php @@ -117,6 +117,10 @@ .button { padding: 12px; box-sizing: border-box;display: inline-block;font-family:arial,helvetica,sans-serif;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #142cb5; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none; } + + .center { + text-align: center; + } @@ -199,7 +203,12 @@