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

Mail content shows only the first line. #174

Open
rothejs opened this issue Dec 13, 2022 · 3 comments
Open

Mail content shows only the first line. #174

rothejs opened this issue Dec 13, 2022 · 3 comments

Comments

@rothejs
Copy link

rothejs commented Dec 13, 2022

Hi,

thanks for providing this awesome plugin.

I found the following issue:
If i only use template variables inside the mail template, then the html newsletter email will only show the first line. (The text mail contains all content). It does not matter how many whitespaces or breaks there are between the variables.

However this behaviour can be fixed if you add any non whitespace unicode character before and after the variables.
In the meantime i have used the "empty space" (U+2800) character as it is not visible.
You have any idea what is causing this issue?

October: v3.1.26
oc-news: latest master commit

Best regards.

@TimFoerster
Copy link
Contributor

Can you provide the code of your mail template and the raw code of your received email?
Do you have email tracking activated?

@rothejs
Copy link
Author

rothejs commented Dec 13, 2022

Sure,

Email tracking and all extra fields are disabled.

Template: indikator.news::mail.email_en
HTML: {{ introductory|raw }}
Text: {{ plaintext }}

Original message:

  • Title: Test
  • Introductory:
Summary

New line

Just default layout without inline css:

MIME-Version: 1.0
Date: Tue, 13 Dec 2022 16:26:38 +0000
Content-Type: multipart/alternative; boundary=feSVl6sX

--feSVl6sX
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<p>Summary</p><p>New line</p>
--feSVl6sX
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head>
    <meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=
=3D1.0" />
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
" />
</head>
<body>
    <style type=3D"text/css" media=3D"screen">
       =20
        @media only screen and (max-width: 600px) {
    .inner-body {
        width: 100% !important;
    }

    .footer {
        width: 100% !important;
    }
}

@media only screen and (max-width: 500px) {
    .button {
        width: 100% !important;
    }
}
    </style>

    <table class=3D"wrapper layout-default" width=3D"100%" cellpadding=3D"0=
" cellspacing=3D"0">

        <!-- Header -->
        <tr>
    <td class=3D"header">
                    <span>
                            Test
       =20
            </span>
            </td>
</tr>
        <tr>
            <td align=3D"center">
                <table class=3D"content" width=3D"100%" cellpadding=3D"0" c=
ellspacing=3D"0">
                    <!-- Email Body -->
                    <tr>
                        <td class=3D"body" width=3D"100%" cellpadding=3D"0"=
 cellspacing=3D"0">
                            <table class=3D"inner-body" align=3D"center" wi=
dth=3D"570" cellpadding=3D"0" cellspacing=3D"0">
                                <!-- Body content -->
                                <tr>
                                    <td class=3D"content-cell">
                                        <p>Summary</p>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <!-- Footer -->
        <tr>
    <td>
        <table class=3D"footer" align=3D"center" width=3D"570" cellpadding=
=3D"0" cellspacing=3D"0">
            <tr>
                <td class=3D"content-cell" align=3D"center">
                    <p>&copy; 2022 October CMS. All rights reserved.</p>
                </td>
            </tr>
        </table>
    </td>
</tr>
    </table>

</body>
</html>
--feSVl6sX--

I also did not expect to see html tags inside the plain text area, but you can see that there is the full message. In the content-cell block there is only the first line

@TimFoerster
Copy link
Contributor

This is OCMS Twig MD renderer related.
You need to wrap {{content | raw}} in a div.

<div>
{{ content | raw }}
</div>

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