Send email to external recipients (own domain)
The service task "Send email to external recipients (own domain)" sends emails to any recipient with a sender address of the company's own domain, without an own mail server and without a Microsoft 365 account. Delivery runs through the Pantarey infrastructure; the sender domain has to be approved for the account. Unlike the other services, this one is not configured with an input expression but in the task properties with the Email editor dialog.
Technical name prio_sendSimpleEmail · Category in the "Select service task" dialog: Email · Frequently used
When is this service used?
- Invoices to customers: Musterfirma GmbH sends invoices from
info@musterfirma-augsburg.dewith the PDF attached and a copy to accounting. - Confirmations and reminders: Appointment confirmations for trainings or reminders about open quotes go to customer addresses.
- No own mail infrastructure: There is no Microsoft 365 and no SMTP access reachable from the internet.
Which email service?
| Service | Sender | Recipients |
|---|---|---|
| Send email to external recipients (own domain) – this page | own domain, approved for the account | any |
| Send email (via SMTP) and from template | own mail server, any address the server allows | any |
| Send email (Microsoft Graph) | Microsoft 365 account | any |
| Send email from template via Pantarey (internal) and Send email via Pantarey (internal) | benachrichtigung@pantarey.io |
users of the own Pantarey account only |
Prerequisites
- The sender domain (e.g.
musterfirma-augsburg.de) has to be approved for the account. Approval is arranged through Pantarey support. Without approval the service answers withstatus403 and sends nothing. - The total size of all attachments must not exceed 5 MB.
Input
This service does not use the input expression. After selecting it, the properties show an email section with the buttons Configure sender, Configure recipients, Configure subject, Edit email body, Configure attachments and Configure HTML data input. Each opens the Email editor dialog at the matching section. The badges Sender, Subject, Recipients and Body show configured or open; once all four are set, the panel reports "Email ready to send – Sender, recipients, subject and body are all set.", otherwise "Email not yet complete".
| Setting in the email editor | Required | Meaning |
|---|---|---|
| Sender email | yes | Full address of the own domain, optionally with display name: "Musterfirma GmbH" <info@musterfirma-augsburg.de>. A JSONata expression is allowed, as is a literal address |
| Subject | yes | Single line. Placeholders $(field.path) and helpers $fn(...) (e.g. $toGermanDate, $substring) are allowed; no free JSONata |
| To (one address per line) | yes | JSONata expression returning an address or an array; literal addresses are allowed, several separated by lines, , or ; |
| Cc (optional), Bcc (optional) | no | like To |
| Reply-To address | no | JSONata or literal address. Empty → support@pantarey.io, not the sender address |
| HTML body (via Edit email body) | yes | Complete HTML in the editor. Handlebars placeholders and helpers such as {{currency_eur …}} or {{dateTimeFormat …}} are rendered against the HTML data input; process values {{value:name}} are inserted beforehand |
| HTML data input (JSONata) → JSONata expression | no | Data for the placeholders, e.g. { "customer": customer, "invoice": invoice }. Empty → the whole incoming message (default $) |
| Attachments → JSONata expression | no | Returns a file object {referenceId, filename, contentType} or an array of them. Entries without referenceId are silently skipped. Total size max. 5 MB |
The dialog does not validate the entries; Apply saves all fields. In the AI change view the same settings are called E-mail template, Subject, To, Cc, Bcc, From, Reply to, Attachments and Data for the template.
Output
{
"status": 200,
"from": "\"Musterfirma GmbH\" <info@musterfirma-augsburg.de>",
"replyTo": "support@pantarey.io",
"recipients": { "to": ["k.huber@kunde.de"], "cc": [], "bcc": ["buchhaltung@musterfirma-augsburg.de"] },
"attachmentCount": 1
}
On a business error, { "status": 400, "message": "…" } or { "status": 403, "message": "…" } is returned instead, without aborting the process. The result is stored under the result path.
Errors and behavior
- Business errors return
{status, message}and the process continues, although no mail was sent. To abort the instance, put the patternstatus = 200 ? $ : $error(message)in the output expression; then an error boundary event takes over or the instance ends in error. - Checks run in this order and the first violation is reported:
toRecipients is required.→Invalid email address(es): …→subject is required.→Either html or text is required.→Invalid sender address: …→Tenant '…' is not allowed to send from domain '…'→Invalid replyTo: …→Attachment is missing referenceId: …→Attachment could not be loaded (referenceId=…)→Attachments exceed maximum total size of 5242880 bytes (5MB).Without approval of the account:Tenant '…' is not authorized to send simple emails.withstatus403. - Technical errors during delivery (service unreachable, mail server rejects) throw: With an error boundary event the process continues there; without one the instance ends in error with a resume point and an error email to the process owner.
- Retries: Up to three attempts only for transient technical errors; a mail may then arrive twice. Business errors are not retried.
- Time limit: 900 seconds per call. The dry run does not send any mail.
Example
Musterfirma GmbH sends an invoice. The message contains customer (email, contact) and invoice (number, gross amount, service month, PDF as file object pdf).
- Sender email:
"Musterfirma GmbH" <info@musterfirma-augsburg.de> - To:
customer.email - Bcc:
buchhaltung@musterfirma-augsburg.de - Subject:
Your invoice $(invoice.number) – Musterfirma GmbH - HTML data input:
{ "customer": customer, "invoice": invoice } - Attachments:
invoice.pdf - HTML body:
<p>Dear {{customer.contact}},</p><p>please find attached your invoice {{invoice.number}} for {{currency_eur invoice.gross}} covering IT consulting in {{month_name invoice.serviceMonth}}.</p> - Output expression:
status = 200 ? $ : $error(message)· Result path:dispatch
Output as above with attachmentCount: 1. The next database step sets the invoice status to "sent"; an error boundary event leads to the user task "Check dispatch".
Frequently asked questions
The panel says \"Email ready to send\", but the step returns toRecipients is required.
The panel also counts Cc or Bcc alone as recipients, but delivery requires at least one address under To. Cc and Bcc complement the To field, they do not replace it.
The process completed, but no mail arrived.
The step returned {status: 400 or 403, message} and the process continued. The message is shown in the Process Explorer under Activities → In/Out. With the output expression status = 200 ? $ : $error(message) the instance aborts in such cases.
Customer replies end up at support@pantarey.io.
Without an entry under Reply-To address this default address applies. Enter the own address there.
A JSONata expression in the subject is not evaluated.
The subject only knows placeholders $(field.path) and helpers such as $toGermanDate(…). Calculations belong in the HTML data input and are inserted in the subject via $(path).
Next step
Handlebars helpers: format amounts, dates and conditions in the HTML content.