Skip to content

Commit

Permalink
Show the preheader in the newsletter preview
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 2, 2024
1 parent 7c0b901 commit 6a63bf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions newsletter-bundle/contao/classes/Newsletter.php
Expand Up @@ -298,8 +298,9 @@ public function send(DataContainer $dc)
<td>' . implode(', ', $arrAttachments) . '</td>
</tr>' : '') . '
</table>' . (!$objNewsletter->sendText ? '
<div class="preview_html">
' . $html . '
<div class="preview_html">' . ($objNewsletter->preheader ? '
<p class="preheader">' . $objNewsletter->preheader . '</p>' : '') . '
' .$html . '
</div>' : '') . '
<div class="preview_text">
<pre style="white-space:pre-wrap">' . $text . '</pre>
Expand Down Expand Up @@ -403,6 +404,11 @@ protected function generateEmailObject(Result $objNewsletter, $arrAttachments)
*/
protected function sendNewsletter(Email $objEmail, Result $objNewsletter, $arrRecipient, $text, $html, $css=null)
{
if (\count(func_get_args()) > 5)
{
trigger_deprecation('contao/newsletter-bundle', '5.3', 'Passing CSS to the Newsletter::sendNewsletter() method has been deprecated and will no longer work in Contao 6. Add the CSS in the template instead.');
}

$simpleTokenParser = System::getContainer()->get('contao.string.simple_token_parser');

// Newsletters with an unsubscribe header are less likely to be blocked (see #2174)
Expand Down
2 changes: 1 addition & 1 deletion newsletter-bundle/public/newsletter.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6a63bf9

Please sign in to comment.