4

I have this issue I don't understand with a civirule that should be sending an email with a .pdf attached when adding a member to a group but it's blocked by Smarty during the process of merging the fields and creating the pdf file.

If I look at Drupal's log, I can identify these User error. I checked the html code with the W3C validator and there's nothing special at it.

They are all related to the style but I don't know how and if can improve anything except using inline style but it's a pdf not an email.

I tried with CKEditor turned off and it changed nothing.

Here are some examples:

User error : Smarty error: [in string:<meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title></title> <style>@page { size: 21cm 29.7cm; margin-left: 1.5cm; margin-right: 1.5cm; margin-top: 1.5cm; margin-bottom: 1.1cm } p { margin-bottom: 0.25cm; direction: ltr; color: #000000; line-height: 115%; orphans: 2; widows: 2; background: transparent } p.western { font-family: "Times New Roman", serif; font-size: 10pt; } h1 { margin-bottom: 0.11cm; direction: ltr; color: #000000; orphans: 2; widows: 2; background: transparent; page-break-after: avoid } h1.western { font-family: "Arial", sans-serif; font-size: 14pt; font-weight: bold } a:link { color: #000080; text-decoration: underline } a:visited { color: #800000; text-decoration: underline } </style> <table align="center" border="0" cellpadding="0" cellspacing="0" class="background" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%;" width="100%"> <tbody> <tr> <td align="center" bgcolor="#FFFFFF" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;" valign="top"> <table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" class="wrapper" style="outline: none;border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;" width="100%"> <tbody> <tr> <td align="center" style="padding: 0px 0px 0px 0px;border-collapse: collapse; border-spacing: 0; margin: 0;" valign="top"><!-- Header Logos --> <div style="padding-bottom:130px"><img alt="logo_SNPMNS" id="logo_SNPMNS" src="https://media.all-in-group.fr/SNPMNS/gestad/Logox2.png" style="border-width: 0px; border-style: none; float: left; width: 385px; height: 117px; margin: 0px;padding-left: 30px;" /> <img alt="axa_logo" id="axa_logo" src="https://media.all-in-group.fr/SNPMNS/gestad/axa_logo.png" style="float: right; border-width: 0px; border-style: none; width: 79px; height: 77px; margin: 0px;padding-right:30px;padding-top:20px;" /></div> <!-- Corps de lettre --> <div style="padding-top:130px"> <p class="western" style="margin-left: 8.4cm; margin-bottom: 0cm; orphans: 2; widows: 2; background: transparent; page-break-before: auto"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>Guillaume Sorel<br />vfdbv<br /><br />bvxb bsv</b></font></p> &nbsp; <p align="center" class="western"><font face="Arial, sans-serif" size="4" style="font-size: 14pt"><b>ATTESTATION D’ASSURANCE RESPONSABILITÉ CIVILE PRESTATAIRE DE SERVICE </b></font></p> &nbsp; <p class="western"><font face="Arial, sans-serif"><font size="2" style="font-size: 10pt"><u><b>Contrat d’assurance n° 639 7892 90 000</b></u> </font></font></p> <p class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>CABINET D’ASSURANCE Sébastien FARINA<br />16, rue Alfred Couturier 78160 - MARLY LE ROI<br />Tél.&nbsp;: 01 39 16 24 15</b></font></p> &nbsp; <p class="western" style="margin-bottom: 0cm; text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">M. Sorel,<br />Conformément à l’obligation d’assurance du Code du Sport et du Code de la Consommation, nous vous signalons que votre contrat d’assurance couvre, en correspondance avec votre cotisation syndicale, la période du </font></p> <h1 align="center" class="western"><font face="Arial, sans-serif" size="2" style="font-size:10pt">28 août 2019 AU 27 août 2020</font></h1> &nbsp; <hr />&nbsp; <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Nous soussignés, SNPMNS 80, boulevard du Général Leclerc B.P.3 92113 CLICHY la GARENNE certifions que&nbsp;:</font></p> <p class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Guillaume Sorel - vfdbv - bvxb bsv</font></p> <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">a versé, au titre de la cotisation syndicale comprenant l’assurance pour l’année à date anniversaire de l’adhésion la somme de&nbsp;</font></p> <p class="western" style="text-align: center;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>SOIXANTE TREIZE EUROS (73 €)</b></font></p> <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">La présente vous est adressée pour toute utilisation, employeur ou autre demande.<br />Restant à votre disposition pour tout renseignement complémentaire, veuillez agréer, cher(e) collègue mes salutations distinguées.</font></p> <div style="padding-right:30px;"> <p align="right" class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Le trésorier,<br />Roland MEUNIER</font></p> <p align="right"><img alt="signature_roland-meunier" border="0" float="right" height="84" id="signature_roland-meunier" src="https://media.all-in-group.fr/SNPMNS/gestad/signature_roland-meunier.jpg" width="94" /></p> </div> </div> <!-- Footer --> <div style="text-align: center;" title="footer"> <p align="center"><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">Centre du Landy <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> 80, boulevard du Général Leclerc B.P. 3 <b>•</b> Clichy-la-Garenne Cedex<br />Téléphone&nbsp;: 01 42 42 95 34 <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> Syndicat régi par la loi du 21 Mars 1884 <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> N° Enregistrement&nbsp;: 92 11 81<br /><a href="mailto:[email protected]" style="color:#2a6099;text-decoration: none;">[email protected]</a> <a href="https://www.snpmns.org" style="color:#2a6099;text-decoration:none">www.snpmns.org</a></font></p> </div> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> line 9]: syntax error: unrecognized tag: color: #800000; text-decoration: underline (Smarty_Compiler.class.php, line 441) dans Smarty->trigger_error() (ligne 1100 dans /home/allingro/gestad/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).


User error : Smarty error: [in string:<meta content="text/html; charset=utf-8" http-equiv="content-type" /> <title></title> <style>@page { size: 21cm 29.7cm; margin-left: 1.5cm; margin-right: 1.5cm; margin-top: 1.5cm; margin-bottom: 1.1cm } p { margin-bottom: 0.25cm; direction: ltr; color: #000000; line-height: 115%; orphans: 2; widows: 2; background: transparent } p.western { font-family: "Times New Roman", serif; font-size: 10pt; } h1 { margin-bottom: 0.11cm; direction: ltr; color: #000000; orphans: 2; widows: 2; background: transparent; page-break-after: avoid } h1.western { font-family: "Arial", sans-serif; font-size: 14pt; font-weight: bold } a:link { color: #000080; text-decoration: underline } a:visited { color: #800000; text-decoration: underline } </style> <table align="center" border="0" cellpadding="0" cellspacing="0" class="background" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0; width: 100%;" width="100%"> <tbody> <tr> <td align="center" bgcolor="#FFFFFF" style="border-collapse: collapse; border-spacing: 0; margin: 0; padding: 0;" valign="top"> <table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" class="wrapper" style="outline: none;border-collapse: collapse; border-spacing: 0; padding: 0; width: inherit;" width="100%"> <tbody> <tr> <td align="center" style="padding: 0px 0px 0px 0px;border-collapse: collapse; border-spacing: 0; margin: 0;" valign="top"><!-- Header Logos --> <div style="padding-bottom:130px"><img alt="logo_SNPMNS" id="logo_SNPMNS" src="https://media.all-in-group.fr/SNPMNS/gestad/Logox2.png" style="border-width: 0px; border-style: none; float: left; width: 385px; height: 117px; margin: 0px;padding-left: 30px;" /> <img alt="axa_logo" id="axa_logo" src="https://media.all-in-group.fr/SNPMNS/gestad/axa_logo.png" style="float: right; border-width: 0px; border-style: none; width: 79px; height: 77px; margin: 0px;padding-right:30px;padding-top:20px;" /></div> <!-- Corps de lettre --> <div style="padding-top:130px"> <p class="western" style="margin-left: 8.4cm; margin-bottom: 0cm; orphans: 2; widows: 2; background: transparent; page-break-before: auto"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>Guillaume Sorel<br />vfdbv<br /><br />bvxb bsv</b></font></p> &nbsp; <p align="center" class="western"><font face="Arial, sans-serif" size="4" style="font-size: 14pt"><b>ATTESTATION D’ASSURANCE RESPONSABILITÉ CIVILE PRESTATAIRE DE SERVICE </b></font></p> &nbsp; <p class="western"><font face="Arial, sans-serif"><font size="2" style="font-size: 10pt"><u><b>Contrat d’assurance n° 639 7892 90 000</b></u> </font></font></p> <p class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>CABINET D’ASSURANCE Sébastien FARINA<br />16, rue Alfred Couturier 78160 - MARLY LE ROI<br />Tél.&nbsp;: 01 39 16 24 15</b></font></p> &nbsp; <p class="western" style="margin-bottom: 0cm; text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">M. Sorel,<br />Conformément à l’obligation d’assurance du Code du Sport et du Code de la Consommation, nous vous signalons que votre contrat d’assurance couvre, en correspondance avec votre cotisation syndicale, la période du </font></p> <h1 align="center" class="western"><font face="Arial, sans-serif" size="2" style="font-size:10pt">28 août 2019 AU 27 août 2020</font></h1> &nbsp; <hr />&nbsp; <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Nous soussignés, SNPMNS 80, boulevard du Général Leclerc B.P.3 92113 CLICHY la GARENNE certifions que&nbsp;:</font></p> <p class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Guillaume Sorel - vfdbv - bvxb bsv</font></p> <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">a versé, au titre de la cotisation syndicale comprenant l’assurance pour l’année à date anniversaire de l’adhésion la somme de&nbsp;</font></p> <p class="western" style="text-align: center;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt"><b>SOIXANTE TREIZE EUROS (73 €)</b></font></p> <p class="western" style="text-align: left;"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">La présente vous est adressée pour toute utilisation, employeur ou autre demande.<br />Restant à votre disposition pour tout renseignement complémentaire, veuillez agréer, cher(e) collègue mes salutations distinguées.</font></p> <div style="padding-right:30px;"> <p align="right" class="western"><font face="Arial, sans-serif" size="2" style="font-size: 10pt">Le trésorier,<br />Roland MEUNIER</font></p> <p align="right"><img alt="signature_roland-meunier" border="0" float="right" height="84" id="signature_roland-meunier" src="https://media.all-in-group.fr/SNPMNS/gestad/signature_roland-meunier.jpg" width="94" /></p> </div> </div> <!-- Footer --> <div style="text-align: center;" title="footer"> <p align="center"><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">Centre du Landy <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> 80, boulevard du Général Leclerc B.P. 3 <b>•</b> Clichy-la-Garenne Cedex<br />Téléphone&nbsp;: 01 42 42 95 34 <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> Syndicat régi par la loi du 21 Mars 1884 <b><font color="#2a6099" face="Arial, sans-serif" size="2" style="font-size: 9pt">•</font></b> N° Enregistrement&nbsp;: 92 11 81<br /><a href="mailto:[email protected]" style="color:#2a6099;text-decoration: none;">[email protected]</a> <a href="https://www.snpmns.org" style="color:#2a6099;text-decoration:none">www.snpmns.org</a></font></p> </div> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> line 9]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 585) dans Smarty->trigger_error() (ligne 1100 dans /home/allingro/gestad/sites/all/modules/civicrm/packages/Smarty/Smarty.class.php).

Any ideas?

SOLUTION brought by DEMERIT: For javascripts and css in template, we have to use {literal}...{/literal} around javascripts or css style declaration. more on smarty documentation

5
  • 1
    Is the styling in a message template, and if so is it wrapped with {literal}...{/literal}?
    – Demerit
    Commented Aug 28, 2019 at 18:29
  • yes it's a message template with HTML not directly sent as it is but transformed into a .pdf sent attached to another message. Before I used smarty, it perfectly worked. Commented Aug 29, 2019 at 7:16
  • I haven't used {literal}...{/literal}. Commented Aug 29, 2019 at 7:17
  • thanks Demerit! this was the answer. You saved my day :-) Commented Aug 29, 2019 at 7:30
  • Great!.........
    – Demerit
    Commented Aug 29, 2019 at 12:53

1 Answer 1

7

The styling needs to be wrapped in {literal}...{/literal} in the message template.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.