I'm using symfony mailer component and making the HTML template with twig.
After sending email in symfony profiler email section, the raw content is something I can't understand!
What are those? do they affect the spamminess level?
And this is my code:
$email = (new TemplatedEmail())
->from(new Address($this->container->getParameter('mailer_no_replay'), 'B2B Marketing'))//TODO: Translation
->to(new Address($lead->getEmail(), $lead->getName()))
->subject($emailTemplate->getSubject())
->htmlTemplate('emails/email-messages/crm-email.html.twig')
->context([
'user' => $lead,
'content' => $mailContent,
]);
$this->mailer->send($email);
And the templates:
1: child (extends 2)
{% extends 'emails/content-email.html.twig' %}
{% block emailMessage %}
{{ content | raw}}
{% endblock %}
2: parent
{% extends 'emails/emailBase.html.twig' %}
{#
This Template used for rendering emails that just have a content not need to render anything else
#}
{% block content %}
<div style="background-color:#ffffff;">
<div class="block-grid"
style="Margin: 0 auto; min-width: 320px; max-width: 790px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; background-color: #e8f5f8;">
<div style="border-collapse: collapse;display: table;width: 100%;background-color:#e8f5f8;">
<!--[if (mso)|(IE)]>
<table width="100%" cellpadding="0" cellspacing="0" border="0"
style="background-color:#ffffff;">
<tr>
<td align="center">
<table cellpadding="0" cellspacing="0" border="0" style="width:790px">
<tr class="layout-full-width" style="background-color:#e8f5f8"><![endif]-->
<!--[if (mso)|(IE)]>
<td align="center" width="790"
style="background-color:#e8f5f8;width:790px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;"
valign="top">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 25px; padding-left: 25px; padding-top:60px; padding-bottom:60px;">
<![endif]-->
<div class="col num12"
style="min-width: 320px; max-width: 790px; display: table-cell; vertical-align: top; width: 790px;">
<div style="width:100% !important;">
<!--[if (!mso)&(!IE)]><!-->
<div
style="border-top:0px solid transparent; border-left:0px solid transparent; border-bottom:0px solid transparent; border-right:0px solid transparent; padding-top:60px; padding-bottom:60px; padding-right: 25px; padding-left: 25px;">
<!--<![endif]-->
<!--[if mso]>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 20px; padding-left: 20px; padding-top: 10px; padding-bottom: 5px; font-family: Arial, sans-serif">
<![endif]-->
<div
style="color:#34495e;font-family:Open Sans, Helvetica Neue, Helvetica, Arial, sans-serif;line-height:1.5;padding-right:20px;padding-bottom:5px;padding-left:20px;">
<div
style="line-height: 1.5; font-size: 13px; color: #34495e; font-family: Open Sans, Helvetica Neue, Helvetica, Arial, sans-serif; mso-line-height-alt: 18px;">
{% block emailMessage %}{% endblock %}
</div>
</div>
</div>
<!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
<!--[if (mso)|(IE)]></td></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
{% endblock %}
These characters are:
Quoted-Printable, or QP encoding, is a binary-to-text encoding system using printable ASCII characters. QP works by using the equals sign = as an escape character.
Example: The following example is a French text (encoded in UTF-8), with a high frequency of letters with diacritical marks (such as the ?�).
J'interdis aux marchands de vanter trop leurs marchandises. Car ils se font=
vite p=C3=A9dagogues et t'enseignent comme but ce qui n'est par essence qu=
'un moyen, et te trompant ainsi sur la route =C3=A0 suivre les voil=C3=
=A0 bient=C3=B4t qui te d=C3=A9gradent, car si leur musique est vulgaire il=
s te fabriquent pour te la vendre une =C3=A2me vulgaire.
=E2=80=94=E2=80=89Antoine de Saint-Exup=C3=A9ry, Citadelle (1948)
This encodes the following quotation:
J'interdis aux marchands de vanter trop leurs marchandises. Car ils se font vite p?�dagogues et t'enseignent comme but ce qui n'est par essence qu'un moyen, et te trompant ainsi sur la route ?� suivre les voil?� bient??t qui te d?�gradent, car si leur musique est vulgaire ils te fabriquent pour te la vendre une ??me vulgaire.
??�??�Antoine de Saint-Exup?�ry, Citadelle (1948)
More details: https://en.wikipedia.org/wiki/Quoted-printable
Thanks to msg.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Symfony compares favorably with other PHP frameworks in terms of reliability and maturity. This framework appeared a long time ago, in 2005, that is, it has existed much longer than most of the other tools we are considering. It is popular for its web standards compliance and PHP design patterns.
https://symfony.com/
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.