All releases
Feature

Mail SDK 1.0: emails.send, templates.send, domains.poll and webhook verification

@productcraft/mail 1.0 gives every Mail operation a method (mail.emails.send(), mail.templates.send(), mail.domains.poll()), with retries, automatic idempotency keys, pagination, typed errors and webhooks.unwrap().

npm install @productcraft/mail now gets you mail.emails.send() for your own HTML, mail.templates.send() for a saved template, and a method for every other Mail call: domains, the delivery log (mail.messages.list() walks every page for you), contacts, broadcasts, suppression and webhook endpoints. mail.domains.poll() waits for a domain to finish verifying, and mail.webhooks.unwrap() checks a delivery's signature and returns a typed event.

Every send carries an idempotency key the SDK generates and reuses on retry, so a retried send never mails twice. Failures are classes you can catch, carrying the error code and request id. The Mail guides and the API reference, which now has a Node tab per operation, use the new methods. Upgrading from 0.x: mail.client still works; the migration guide shows each call before and after.