Skip to content

Add plan for mailgun transition for transactional email provider#628

Draft
alexkgold wants to merge 2 commits intomainfrom
feat/mailgun-transactional-provider
Draft

Add plan for mailgun transition for transactional email provider#628
alexkgold wants to merge 2 commits intomainfrom
feat/mailgun-transactional-provider

Conversation

@alexkgold
Copy link
Contributor

@alexkgold alexkgold commented Feb 26, 2026

Context

We're migrating our transactional email infrastructure from Customer.io to Mailgun, as recommended by our email deliverability providers. As part of this migration, email template content (previously managed in Customer.io's GUI) will move into code in the cloud repo. This PR contains the 12 HTML email templates plus a markdown file laying out the implementation plan.

Complication

This is a high-stakes change — transactional emails are customer-facing and business-critical, so we need confidence in both the architecture and our ability to test safely before going live.

Question

Does the implementation plan hold up to scrutiny, and are we set up to ship this safely?

Request

The markdown file is the primary thing needing review. I'm requesting feedback focused on three areas:

  1. Overall architecture — Does the general approach make sense? Any concerns?
  2. Template file location — Where in the repo should the 12 HTML email templates live?
  3. Pre-launch testing strategy — How should we test this before it goes live?

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 26, 2026

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/lib/emails/ossInviteNewUser.html 80 Template still contains {% if has_credits %}...{% endif %}; with {{ variable }}-only rendering this conditional will not be evaluated and raw tags may leak into user emails.
src/lib/emails/ossInviteExistingUser.html 80 Template still contains {% if has_credits %}...{% endif %}; with {{ variable }}-only rendering this conditional will not be evaluated and raw tags may leak into user emails.
src/lib/emails/ossExistingOrgProvisioned.html 79 Template still contains {% if has_credits %}...{% endif %}; with {{ variable }}-only rendering this conditional will not be evaluated and raw tags may leak into user emails.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

None.

Files Reviewed (14 files)
  • plans/migrate-email-to-mailgun.md - 0 issues
  • src/lib/emails/AGENTS.md - 0 issues
  • src/lib/emails/autoTopUpFailed.html - 0 issues
  • src/lib/emails/balanceAlert.html - 0 issues
  • src/lib/emails/deployFailed.html - 0 issues
  • src/lib/emails/magicLink.html - 0 issues
  • src/lib/emails/orgCancelled.html - 0 issues
  • src/lib/emails/orgInvitation.html - 0 issues
  • src/lib/emails/orgRenewed.html - 0 issues
  • src/lib/emails/orgSSOUserJoined.html - 0 issues
  • src/lib/emails/orgSubscription.html - 0 issues
  • src/lib/emails/ossExistingOrgProvisioned.html - 1 issue
  • src/lib/emails/ossInviteExistingUser.html - 1 issue
  • src/lib/emails/ossInviteNewUser.html - 1 issue

Fix these issues in Kilo Cloud

"
>
• <strong style="color: #d1d5db">{{ seats }} Enterprise Seats</strong> (a ${{
seat_value }} value){% if has_credits %}<br />•
Copy link
Contributor

Choose a reason for hiding this comment

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

WARNING: Unrendered Liquid conditional will leak into sent email

This template still contains {% if has_credits %}...{% endif %}. The migration plan describes rendering with simple {{ variable }} replacement, so this conditional syntax will not be evaluated and will appear literally in outgoing emails.

"
>
• <strong style="color: #d1d5db">{{ seats }} Enterprise Seats</strong> (a ${{
seat_value }} value){% if has_credits %}<br />•
Copy link
Contributor

Choose a reason for hiding this comment

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

WARNING: Unrendered Liquid conditional will leak into sent email

This template still contains {% if has_credits %}...{% endif %}. With the proposed {{ variable }}-only renderer, this block will not be processed and raw template tags will be delivered to users.

"
>
• <strong style="color: #d1d5db">{{ seats }} Enterprise Seats</strong> (a ${{
seat_value }} value){% if has_credits %}<br />•
Copy link
Contributor

Choose a reason for hiding this comment

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

WARNING: Unrendered Liquid conditional will leak into sent email

This template still uses {% if has_credits %}...{% endif %}. Unless a Liquid engine is used, the new server-side interpolation approach will not handle this and the conditional markup will show up in the email body.

@alexkgold alexkgold marked this pull request as draft February 26, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant