Send a transactional email
Sends a message from the specified domain. You can track deliverability (delivered, bounced, complaint, rejected) using Nylas' notifications.
The route's domain_name value is the verified sender domain. To use a different custom hostname for link click or message open tracking, provide tracking_options.domain_name in the request body. For example, you can send from sender.example.com and track through tracking.example.com. Nylas validates scheduled custom tracking hostnames when you create the schedule and revalidates them immediately before delivery. If an explicit hostname is no longer eligible, the send fails without falling back to a Nylas hostname.
<div id="admonition-info">💡 <b>Emails landing in spam?</b> Consider <a href="/docs/v3/agent-accounts/domain-warming/">warming up your email domain</a> to improve deliverability.</div>Request body
Example request
{
"attachments": [
{
"content": "YXR0YWNoDQoNCi0tLS0tLS0tLS0gRm9yd2FyZGVkIG1lc3NhZ2UgL=",
"content_disposition": "attachment; filename=\"nylas_logo.png\"",
"content_id": "ce9b9547-9eeb-43b2-ac4e-58768bdf04e4",
"content_type": "image/png",
"filename": "nylas_logo.png"
}
],
"bcc": [
{
"email": "leyah@example.com",
"name": "Leyah Miller"
}
],
"body": "Looking forward to seeing you!",
"cc": [
{
"email": "leyah@example.com",
"name": "Leyah Miller"
}
],
"custom_headers": [
{
"name": "Email-Campaign",
"value": "meetings"
}
],
"from": {
"email": "nyla@example.com",
"name": "Nyla"
},
"is_plaintext": true,
"reply_to": [
{
"name": "Leyah Miller",
"email": "leyah@example.com"
}
],
"subject": "Reminder: Annual Philosophy Club meeting",
"template": {
"id": "b79c82b2-a51b-4c54-8469-28006a43551a",
"strict": true,
"variables": {
"user": {
"name": "Leyah",
"surname": "Miller"
}
}
},
"to": [
{
"email": "leyah@example.com",
"name": "Leyah Miller"
}
],
"tracking_options": {
"domain_name": "tracking.example.com"
}
}Response
Success. Returns message.
Example response
{
"data": {
"id": "6c45fe5e-0bb6-41b9-9acc-ccb15bfc51eb",
"attachments": [
{
"content_disposition": "attachment",
"content_type": "text/calendar",
"filename": null,
"content_id": "4kj2jrcoj9ve5j9yxqz5cuv98",
"size": 1708
},
{
"content_disposition": "attachment",
"content_type": "application/ics",
"filename": "invite.ics",
"content_id": "70jcsv367jaiavt4njeu4xswg",
"size": 1708
}
],
"bcc": [
{
"name": "Jon Snow",
"email": "jon.snow@example.com"
}
],
"body": "Hello, I just sent a message using Nylas!",
"cc": [
{
"name": "Jon Snow",
"email": "jon.snow@example.com"
}
],
"from": [
{
"name": "Jon Snow",
"email": "jon.snow@example.com"
}
],
"object": "message",
"reply_to": [
{
"name": "Jon Snow",
"email": "jon.snow@example.com"
}
],
"snippet": "You have been invited to the following event. Welcome! WhenThu Oct 28, 2021 7am - 8am Eastern\nTime - Toronto Joining info",
"subject": "Nylas Send v3 Email",
"tracking_options": {
"opens": true,
"links": true,
"label": "Tracking test"
},
"to": [
{
"name": "Jon Snow",
"email": "jon.snow@example.com"
}
]
},
"request_id": "9ca1d434-5ac7-4331-b8fb-3749c9a758d3"
}Changes
No recorded changes to this endpoint across all 1 revision of this API.