emails.send
The mail your own code decides to send, with no journey and no rule behind it.
const { deliveryId } = await cow.emails.send({ template: { key: "receipt", props: { orderId: "A-2291" } },});Or write the message inline:
await cow.emails.send({ subject: "Your receipt", html: "<p>Thanks for your order.</p>",});| Field | Required | Notes |
|---|---|---|
to |
yes | One address or a list, up to 50. cc, bcc and replyTo take the same. |
template |
either | { key, props }: a template you pushed, and the props it declares. It writes the whole message. |
subject + html / text |
either | An inline message. Refused beside a template. |
from |
yes | An address on a domain your organization verified. There is no other. |
headers |
no | Passed on as you wrote them. |
sourceId |
on the wire | The client’s, unless the call names one. |
The promise resolves once the message has been handed over, and deliveryId is the row in Deliveries that records what happened to it.
What is checked
Section titled “What is checked”Your credit, then your suppression list, then the from-address. An address that has bounced or complained is dropped from the message; if that leaves nobody, the call still answers with an id and the delivery records that it was suppressed.
Only a transactional template can be sent this way. A marketing template is refused, because a direct send carries no consent purpose, so there is nothing to check an unsubscribe against. Send those from a journey.
Already sending with Resend?
Section titled “Already sending with Resend?”Point the Resend SDK at Cowliss and keep the code you have. See Resend SDK.