Use Case
Send account notifications with Postkit
Notify users about security events, plan changes, and account activity. Postkit's scheduled delivery lets you batch non-urgent notifications for optimal timing.
Get Started FreeThe problem
Account notifications range from urgent (login from new device) to informational (monthly usage summary). You need an API that can send immediately or schedule for later, with tracking for both.
The Postkit solution
Use Postkit's send_at field for scheduled delivery (up to 72 hours). Urgent notifications send immediately. Both support webhooks for delivery confirmation.
account-notification.ts
// Immediate security alert
await fetch("https://api.postkit.eu/v1/emails", {
method: "POST",
headers: {
Authorization: "Bearer pk_live_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "security@yourapp.eu",
to: user.email,
subject: "New login from Berlin, Germany",
html: `<p>We noticed a login from a new device.</p>
<p>If this wasn't you, <a href="${lockUrl}">secure your account</a>.</p>`,
}),
});
// Scheduled usage summary (tomorrow at 9am)
await fetch("https://api.postkit.eu/v1/emails", {
method: "POST",
headers: {
Authorization: "Bearer pk_live_...",
"Content-Type": "application/json",
},
body: JSON.stringify({
from: "notifications@yourapp.eu",
to: user.email,
subject: "Your weekly usage summary",
template_id: "tmpl_usage_summary",
data: { stats: weeklyStats },
send_at: "2026-04-11T09:00:00Z",
}),
});