Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
de501f5
feat(emails): transactional emails for top-up and KiloClaw purchase
kilo-code-bot[bot] Apr 28, 2026
2d52765
fix(emails): add fixture vars for creditsTopUp and kiloClawSubscripti…
Apr 29, 2026
4695fef
fix(emails): gate kiloclaw subscription-started email on first paid p…
Apr 29, 2026
e31b6eb
fix(emails): recover kiloclaw subscription-started email on duplicate…
evanjacobson May 4, 2026
b01e8ab
fix(emails): match kiloclaw subscription-created activation on period…
evanjacobson May 4, 2026
6574126
test(emails): scope stale-recovery subscription_change_log update by …
evanjacobson May 4, 2026
47fc413
fix(emails): dedupe kiloclaw subscription-started email by activation…
evanjacobson May 4, 2026
f6ee058
fix(emails): send kiloclaw subscription-started email on $0 settlements
evanjacobson May 4, 2026
0dfc67e
fix(emails): clear kiloclaw subscription-started email log when provi…
evanjacobson May 4, 2026
69e114b
chore(emails): replace import() type annotation with top-level type i…
evanjacobson May 4, 2026
373e0de
test(emails): mock Mailgun transport instead of helper exports
evanjacobson May 4, 2026
acf3d7a
fix(emails): neutralize 'first billing period' copy in subscription-s…
evanjacobson May 4, 2026
d6fe7c5
fix(emails): recover top-up confirmation email on duplicate webhook r…
evanjacobson May 4, 2026
9081b64
test(emails): cover past_due and unpaid dunning settlement branches
evanjacobson May 4, 2026
6e3692a
refactor(emails): drop 31-day recovery window in settlement activatio…
evanjacobson May 4, 2026
b8daf9a
fix(emails): point subscription-started manage CTA at /claw/subscription
evanjacobson May 4, 2026
c4fbffa
fix(emails): look up user before inserting subscription-started email…
evanjacobson May 5, 2026
16d0998
docs(emails): acknowledge known gaps in insert-before-send email markers
evanjacobson May 5, 2026
c8a1504
refactor(emails): surface non-benign Stripe errors in receipt lookup
evanjacobson May 5, 2026
ed4e9f8
perf(emails): short-circuit duplicate-settlement change-log scan
evanjacobson May 5, 2026
b998bb3
Renamed top_up_email_log to transactional_email_log
evanjacobson May 5, 2026
2b9afc4
Use JSDoc comments inm credits.ts and credit-billing.ts
evanjacobson May 5, 2026
6e772b7
Reduce redundant comments
evanjacobson May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/web/src/emails/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ Every template must include this branding footer below the content table:
| `clawEarlybirdExpiresTomorrow.html` | `expiry_date`, `claw_url`, `year` | `30` |
| `clawComplementaryInferenceEnded.html` | `claw_url`, `year` | — |
| `accountDeletionRequest.html` | `email`, `year` | — |
| `creditsTopUp.html` | `heading`, `intro`, `amount_usd`, `credits_usd`, `purchase_date`, `credits_url`, `receipt_section`, `year` | — |
| `kiloClawSubscriptionStarted.html` | `plan_name`, `price_usd`, `billing_period`, `next_billing_date`, `manage_url`, `year` | — |
211 changes: 211 additions & 0 deletions apps/web/src/emails/creditsTopUp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ heading }}</title>
</head>
<body
style="
margin: 0;
padding: 0;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background-color: #ffffff;
color: #1a1a1a;
"
>
<table width="100%" cellpadding="0" cellspacing="0" style="background-color: #ffffff">
<tr>
<td align="center" style="padding: 40px 20px">
<table width="520" cellpadding="0" cellspacing="0">
<!-- Header -->
<tr>
<td style="padding: 40px 40px 20px">
<h1
style="
margin: 0;
font-size: 24px;
font-weight: 700;
color: #1a1a1a;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
{{ heading }}
</h1>
</td>
</tr>
<!-- Body -->
<tr>
<td style="padding: 0 40px 20px">
<p
style="
margin: 0 0 16px;
font-size: 14px;
line-height: 22px;
color: #333;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
{{ intro }}
</p>
</td>
</tr>
<!-- Detail box -->
<tr>
<td style="padding: 0 40px 20px">
<table
width="100%"
cellpadding="0"
cellspacing="0"
style="background-color: #f6f6f4; border: 1px solid #ebebea; border-radius: 10px"
>
<tr>
<td style="padding: 16px 20px">
<p
style="
margin: 0 0 8px;
font-size: 13px;
line-height: 20px;
color: #555;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
<strong style="color: #1a1a1a">Amount:</strong> ${{ amount_usd }} USD
</p>
<p
style="
margin: 0 0 8px;
font-size: 13px;
line-height: 20px;
color: #555;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
<strong style="color: #1a1a1a">Credits:</strong> ${{ credits_usd }} USD
</p>
<p
style="
margin: 0;
font-size: 13px;
line-height: 20px;
color: #555;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
<strong style="color: #1a1a1a">Date:</strong> {{ purchase_date }}
</p>
</td>
</tr>
</table>
</td>
</tr>
<!-- CTA -->
<tr>
<td style="padding: 0 40px 20px">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="padding: 10px 0 20px">
<a
href="{{ credits_url }}"
style="
display: inline-block;
padding: 10px 20px;
background-color: #1a1a1a;
color: #ffffff;
text-decoration: none;
border-radius: 7px;
font-size: 13px;
font-weight: 600;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
View your balance
</a>
</td>
</tr>
</table>
<p
style="
margin: 0;
font-size: 13px;
line-height: 20px;
color: #555;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
{{ receipt_section }}
</p>
</td>
</tr>
<!-- Sign-off -->
<tr>
<td style="padding: 0 40px 40px; border-top: 1px solid #ebebea">
<p
style="
margin: 20px 0 0;
font-size: 14px;
line-height: 20px;
color: #333;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
If you have any questions, reply to this email — we're here to help.
</p>
<p
style="
margin: 16px 0 0;
font-size: 14px;
line-height: 20px;
color: #333;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
— The Kilo Team
</p>
</td>
</tr>
</table>
<!-- Branding Footer -->
<table width="520" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="padding: 30px 20px; border-top: 1px solid #eee">
<p
style="
margin: 0;
font-size: 11px;
color: #ccc;
font-family:
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
sans-serif;
"
>
© {{ year }} Kilo Code, Inc<br />455 Market St, Ste 1940 PMB 993504<br />San
Francisco, CA 94105, USA
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Loading