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

Add template body text optional inliner #155

Merged
merged 10 commits into from
Feb 14, 2025

Conversation

xavierteres
Copy link
Contributor

@xavierteres xavierteres commented May 23, 2024

Objectius

Cada visualitzador de e-mails implementa la visualització HTML una mica diferent i això fa que la visualització de e-mails sigui a part de complicada, poc cohesionada.

Una de les solucions més comunes per intentar cohesionar la visualització al màxim és posar el CSS dintre de cada etiqueta (inlining) d'aquesta manera els visualitzadors no poden "decidir" tant i els més antics suporten millor el CSS.

L'inlining es pot activar o desactivar a través d'un boolean a la plantilla del correu.

Comportament amb inlining

L'exemple més bàsic de la llibreria i amb el que passem als testos

Codi sense inlining.

<html>
<style type="text/css">
h1 { border:1px solid black }
p { color:red;}
</style>
<h1 style="font-weight:bolder">Peter</h1>
<p>Hej</p>
</html>

Un cop passat l'inlining

<html>
<h1 style="font-weight:bolder; border:1px solid black">Peter</h1>
<p style="color:red">Hej</p>
</html>

La PR conté testos per totes les funcions tocades i un script de migració.

Co-authored-by: Daniel Estanyol i Torres <[email protected]>
Copy link
Member

@lcbautista lcbautista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Documenteu la PR, no se sap que fa sense haver de llegir el codi.
  • Tests si su plau

@destanyol
Copy link
Contributor

Right away!

@xavierteres xavierteres marked this pull request as ready for review May 24, 2024 10:06
poweremail_template.py Outdated Show resolved Hide resolved
requirements.txt Show resolved Hide resolved
Copy link

🔄 Starting tests execution...
👉 Track execution

Copy link

🔄 Tests execution finished.
👉 Track execution

Result:
Tests passed!

@lcbautista lcbautista merged commit 57f52d3 into gisce:v5_backport Feb 14, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants