fix: refactor email template with proper Mako syntax and test markers
This commit is contained in:
parent
f160f1c476
commit
a283b3f460
1 changed files with 36 additions and 35 deletions
|
|
@ -5,39 +5,42 @@
|
||||||
<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:
|
|
||||||
<h4>Twitter</h4>
|
|
||||||
% if social.twitter_post_a:
|
% if social.twitter_post_a:
|
||||||
<p><strong>Post A:</strong> ${social.twitter_post_a}</p>
|
<h4>Twitter Post A</h4>
|
||||||
% endif
|
<p>${social.twitter_post_a}</p>
|
||||||
% if social.twitter_post_b:
|
% endif
|
||||||
<p><strong>Post B:</strong> ${social.twitter_post_b}</p>
|
|
||||||
% endif
|
% if social.twitter_post_b:
|
||||||
|
<h4>Twitter Post B</h4>
|
||||||
|
<p>${social.twitter_post_b}</p>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
% if social.bluesky_post_a or social.bluesky_post_b:
|
|
||||||
<h4>BlueSky</h4>
|
|
||||||
% if social.bluesky_post_a:
|
% if social.bluesky_post_a:
|
||||||
<p><strong>Post A:</strong> ${social.bluesky_post_a}</p>
|
<h4>BlueSky Post A</h4>
|
||||||
|
<p>${social.bluesky_post_a}</p>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
% if social.bluesky_post_b:
|
% if social.bluesky_post_b:
|
||||||
<p><strong>Post B:</strong> ${social.bluesky_post_b}</p>
|
<h4>BlueSky Post B</h4>
|
||||||
% endif
|
<p>${social.bluesky_post_b}</p>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
% if social.mastodon_post:
|
% if social.mastodon_post:
|
||||||
|
|
@ -50,9 +53,7 @@
|
||||||
<p>${social.linkedin_post}</p>
|
<p>${social.linkedin_post}</p>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
<p><strong>URL:</strong> https://itsulu.com${object.blog_post_id.website_url or ''}</p>
|
% endif
|
||||||
|
|
||||||
% endfor
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
]]></field>
|
]]></field>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue