On September 13, we faced a challenge: CRM sales emails were landing in Gmail stripped of visual styling. We needed a quick fix to ensure emails looked polished and professional.
The crm-gen-html endpoint was destructively stripping <style> blocks.
We installed Juice to convert <style> CSS to inline styles.
Gmail removes modern CSS like gradients and flexbox.
The CRM AI now enforces email-safe CSS for better rendering.
Fixing the style stripping issue.
The first problem was that the crm-gen-html endpoint in dashboard-server.js was stripping out <style> blocks entirely. This left emails without necessary visual elements.
To resolve this, we integrated Juice on N1. It inlines CSS styles before sending the email. We also added bgcolor HTML attributes as a fallback for background colors.
Addressing graphics and CSS limitations.
Next, we tackled why graphics were missing in HTML emails. Gmail and Outlook have strict rules on CSS. They remove modern features like gradients and media queries.
We updated the CRM AI email prompt to enforce email-safe CSS, ensuring that only solid colors, borders, and inline styles were allowed. A post-processor now strips any remaining unsafe CSS.
Testing and deployment.
After making these changes, we tested the emails in the CRM preview. They looked good in the browser, but we had to confirm they would arrive intact in Gmail.
Both fixes were deployed to N1 and easone, with services restarted to ensure everything was running smoothly.