Email sending
Receipts, sign-in links and notifications sent from the app. The draft keeps them in its outbox instead.
In stackly.json and the CLI it is email. Its use, live or draft, is counted as emails sent; see Live app prices.
email · optional · needs backend · Email Service · binding APP_EMAIL
Transactional email: receipts, confirmations, sign-in links, notifications.
Turn it on
"features": ["backend", "email"]
Use it
import { sendBrandedEmail, sendEmail } from "#/lib/email.server";
await sendEmail({
to: order.email,
subject: "Your order is on its way",
text: "Hi! Your order #1042 left our shop today.",
from: "orders", // orders.<app>@stackly-site.app; default "no-reply"
fromName: "Bella's Bakery",
replyTo: ownerAddress, // without it, replies go nowhere
});
await sendBrandedEmail({
to: user.email,
subject: "Confirm your address",
paragraphs: ["Thanks for signing up."],
button: { label: "Confirm", url: link },
after: ["If you did not ask for this, ignore this email."],
});
sendBrandedEmailuses one layout for every email, styled by the owner.brandedBodies()gives its HTML and text for previews and tests.- Hand bulk or slow sending to a
queuesjob.
Owner settings
Declare the ones the owner may change, with "feature": "email": email-brand-name (text), email-brand-color
(text, #rrggbb), email-logo-url (url), email-footer (long-text), email-reply-to (email). Texts such as a
welcome subject belong in settings too.
Limits
At most 10 recipients per email and 100 emails a day. Each email ends with a line naming the app.
Don't
Send only email the recipient asked for. Never send marketing email with this.
Locally
The draft keeps every email in the outbox; stackly dev prints it, body and links included. Only live sends.
Related
inbox to receive replies at the app's address.