Overview
DoorStax sends branded transactional emails for every significant event in the platform. All templates are built using a shared layout system defined in _layout.ts that provides consistent styling with emailStyles,emailHeader, andemailFooter helpers. Each template is a standalone function that returns an HTML string.
Template Reference
The following table lists every email template in the system, along with its trigger event and recipient.
| Template | Trigger | Recipient | Description |
|---|---|---|---|
| tenant-invite | PM invites tenant | Tenant | Invitation to join the DoorStax tenant portal |
| payment-received | Successful payment | Tenant + PM | Payment confirmation with receipt details |
| payment-failed | Failed payment | Tenant + PM | Payment failure notification with retry info |
| rent-due-reminder | 3 days before due (cron) | Tenant | Upcoming rent due date reminder |
| rent-overdue | 1/5/15/30 days late (cron) | Tenant + PM | Escalating overdue rent notifications |
| autopay-upcoming | 3 days before autopay charge | Tenant | Pre-charge notification for autopay tenants |
| autopay-paused | Max retries exceeded | Tenant | Autopay suspended due to repeated failures |
| autopay-enrollment | Monthly enrollment reminder | Tenant | Encourages non-autopay tenants to enroll |
| payment-refunded | Refund processed | Tenant | Refund confirmation with amount and reason |
| chargeback-notification | Chargeback filed | PM | Alert that a chargeback has been initiated |
| expense-invoice | Tenant-payable expense created | Tenant | Invoice for a charge assigned to the tenant |
| eviction-notice | Eviction case created | Tenant | Formal eviction notice email |
| payout-processed | Owner payout sent | Owner | Payout confirmation with breakdown |
| lease-expiration | 90/60/30/14/7 days before expiry | PM + Tenant | Tiered lease expiration reminders |
| welcome-pm | New PM registration | PM | Welcome email with onboarding steps |
| password-reset | Password reset request | User | Secure password reset link |
| owner-statement | Monthly statement generated | Owner | Monthly financial statement with PDF attachment |
| onboarding-complete | Tenant finishes onboarding | PM | Notification that tenant setup is complete |
| two-factor-code | 2FA verification | User | One-time verification code for login |
| new-message | New message received | User | In-app message notification |
| acquiring-agreement | Signed merchant agreement | Admin | Merchant acquiring agreement confirmation |
Customization
All email templates use DoorStax branding with a purple accent color scheme. The header includes the DoorStax logo, and the footer includes Kadima payment branding, support links, and unsubscribe options. Emails are rendered as inline-styled HTML for maximum email client compatibility.
Shared Layout
The shared layout is defined in _layout.ts and exports three helpers used by every template:
| Export | Description |
|---|---|
| emailStyles | CSS object with brand colors, fonts, spacing, and responsive breakpoints |
| emailHeader | Returns the HTML header block with DoorStax logo and purple gradient bar |
| emailFooter | Returns the HTML footer with Kadima branding, support email, and legal links |
import { emailStyles, emailHeader, emailFooter } from "./_layout";
export function paymentReceivedEmail(data) {
return `
<!DOCTYPE html>
<html>
<head><style>${emailStyles}</style></head>
<body>
${emailHeader()}
<div style="padding: 32px;">
<h1>Payment Received</h1>
<p>Amount: $${(data.amount / 100).toFixed(2)}</p>
<p>Property: ${data.propertyName}</p>
<p>Unit: ${data.unitName}</p>
<p>Date: ${data.date}</p>
<p>Confirmation: ${data.confirmationNumber}</p>
</div>
${emailFooter()}
</body>
</html>
`;
}