Rich content: HTML formatting, images, detailed information
Asynchronous communication: Messages that don’t require immediate attention
Email operates as a separate channel and does not participate in smart routing. You must explicitly specify channel: "email" or send to an email address.
const result = await zavu.messages.send({ to: "user@example.com", channel: "email", subject: "Your order has shipped", text: "Hi John, your order #12345 has shipped and will arrive in 2-3 business days."});
You can optionally specify a sender by passing zavuSender (TypeScript), zavu_sender (Python), or the Zavu-Sender header (cURL). If omitted, your project’s default sender is used.
Send rich HTML emails by including htmlBody. The text field serves as the plain-text fallback:
const result = await zavu.messages.send({ to: "user@example.com", channel: "email", subject: "Welcome to Zavu", text: "Welcome to Zavu! We are excited to have you on board.", htmlBody: ` <h1>Welcome to Zavu!</h1> <p>We are excited to have you on board.</p> <a href="https://dashboard.zavu.dev">Get Started</a> `, replyTo: "support@yourcompany.com"});
<h1>Your Order Has Shipped!</h1><p>Hi John, your order #12345 has shipped.</p><p>Track your package: <a href="https://track.co/abc">View Tracking</a></p><hr><p style="font-size: 12px; color: #666;"> YourCompany, Inc. | 123 Main St, San Francisco, CA 94102<br> <a href="https://yourcompany.com/unsubscribe">Unsubscribe</a></p>