Access mail methods viaDocumentation Index
Fetch the complete documentation index at: https://docs.ub.bitbros.in/llms.txt
Use this file to discover all available pages before exploring further.
client.mail. This module allows you to send emails using your project’s configured mail provider (e.g. Resend).
send
Send an email.SendMailPayload)
| Field | Type | Required | Description |
|---|---|---|---|
to | string | string[] | Yes | Recipient email address(es). |
subject | string | Template mode: No, Direct mode: Yes | Email subject line. |
text | string | Direct mode: one of text or html is required | Plain text body. |
html | string | Direct mode: one of text or html is required | HTML body. |
templateId | string | Template mode: one of templateId or templateName is required | Mail template ObjectId. |
templateName | string | Template mode: one of templateId or templateName is required | Template key/name lookup. |
variables | Record<string, unknown> | No | Variables used in template rendering. |
Payload modes
Use one of these modes:- Template mode:
templateIdortemplateName(+ optionalvariables) - Direct mode:
subject+ at least one oftextorhtml
templateId and templateName in the same request.
Template resolution order
When you usetemplateName, urBackend resolves templates in this order:
- Project template (override)
- Global/system template
- Legacy embedded project template fallback (older projects only)
Placeholder syntax
- Escaped placeholder:
{{name}} - Raw placeholder:
{{{htmlSnippet}}}(use carefully) - Nested variables:
{{user.name}}
{{appUrl}}. URL-like variables are sanitized to safe http/https URLs before rendering.
Returns (SendMailResponse)
| Field | Type | Description |
|---|---|---|
id | string | null | The message ID from the provider (null if unavailable). |
provider | "byok" | "default" | The provider used for sending. |
monthlyUsage | number | Total emails sent this month. |
monthlyLimit | number | Your project’s monthly quota. |
