fix: refactor email template with proper Mako syntax and test markers

This commit is contained in:
Nicholas Riegel 2026-05-29 23:36:14 -04:00
parent f160f1c476
commit a283b3f460

View file

@ -5,54 +5,55 @@
<record id="email_template_blog_published" model="mail.template"> <record id="email_template_blog_published" model="mail.template">
<field name="name">Blog Publisher — Post Published Notification</field> <field name="name">Blog Publisher — Post Published Notification</field>
<field name="model_id" ref="model_itsulu_blog_generation_log"/> <field name="model_id" ref="model_itsulu_blog_generation_log"/>
<field name="subject">Blog Post Published: ${object.blog_post_id.name or 'New Post'}</field> <field name="subject">[ITSulu Insights] Blog Post Published: ${object.blog_post_id.name}</field>
<field name="email_from">${user.email_formatted}</field> <field name="email_from">${user.email_formatted}</field>
<field name="auto_delete">True</field> <field name="auto_delete">True</field>
<field name="body_html"><![CDATA[ <field name="body_html"><![CDATA[
<div style="font-family: Arial, sans-serif; line-height: 1.6;"> <div style="font-family: Arial, sans-serif; line-height: 1.6; max-width: 700px;">
<h2>Blog Post Published</h2> <h2>Blog Post Published</h2>
<p><strong>Title:</strong> ${object.blog_post_id.name or 'N/A'}</p> <p><strong>Title:</strong> ${object.blog_post_id.name}</p>
<p><strong>Blog:</strong> ${object.blog_post_id.blog_id.name or 'N/A'}</p> <p><strong>Blog:</strong> ${object.blog_post_id.blog_id.name}</p>
<p><strong>URL:</strong> <a href="https://itsulu.com${object.blog_post_id.website_url}">https://itsulu.com${object.blog_post_id.website_url}</a></p>
<h3>Social Media Posts — Ready to Post</h3> <h3>Social Media Posts — Ready to Post</h3>
% for social in object.blog_post_id.itsulu_social_id: % set social_records = object.blog_post_id.itsulu_social_id
% if social_records:
% set social = social_records[0]
% if social.twitter_post_a or social.twitter_post_b: % if social.twitter_post_a:
<h4>Twitter</h4> <h4>Twitter Post A</h4>
% if social.twitter_post_a: <p>${social.twitter_post_a}</p>
<p><strong>Post A:</strong> ${social.twitter_post_a}</p> % endif
% endif
% if social.twitter_post_b:
<p><strong>Post B:</strong> ${social.twitter_post_b}</p>
% endif
% endif
% if social.bluesky_post_a or social.bluesky_post_b: % if social.twitter_post_b:
<h4>BlueSky</h4> <h4>Twitter Post B</h4>
% if social.bluesky_post_a: <p>${social.twitter_post_b}</p>
<p><strong>Post A:</strong> ${social.bluesky_post_a}</p> % endif
% endif
% if social.bluesky_post_b:
<p><strong>Post B:</strong> ${social.bluesky_post_b}</p>
% endif
% endif
% if social.mastodon_post: % if social.bluesky_post_a:
<h4>Mastodon</h4> <h4>BlueSky Post A</h4>
<p>${social.mastodon_post}</p> <p>${social.bluesky_post_a}</p>
% endif % endif
% if social.linkedin_post: % if social.bluesky_post_b:
<h4>LinkedIn</h4> <h4>BlueSky Post B</h4>
<p>${social.linkedin_post}</p> <p>${social.bluesky_post_b}</p>
% endif % endif
<p><strong>URL:</strong> https://itsulu.com${object.blog_post_id.website_url or ''}</p> % if social.mastodon_post:
<h4>Mastodon</h4>
<p>${social.mastodon_post}</p>
% endif
% endfor % if social.linkedin_post:
<h4>LinkedIn</h4>
<p>${social.linkedin_post}</p>
% endif
% endif
</div> </div>
]]></field> ]]></field>