Notifications

Send email

Send a transactional email on behalf of a project using the project's dedicated sending domain.

Either html or text (or both) must be provided as the email body. Omit from to send from the project's default sender. from can pick one of the project's verified senders (Hosting > Email) or, on a verified domain, set a display name; any other value is ignored and reported in warning.

Up to 10 attachments can be included; each attachment is fetched from its url and streamed for delivery. Recipients (to, cc, bcc): the secret key may email anyone, a signed-in user or a signed-out caller only the project owner.

post/api/notifications/{project_id}/email

Request

  • Base URL
    https://core.blink.new
  • URL
    https://core.blink.new/api/notifications/{project_id}/email
  • Auth
    HTTP bearer

Path parameters

project_idstring required
Example:my-project-123

Unique identifier for the project

Request body

subjectstring required

Email subject line

htmlstring

HTML content of the email

textstring

Plain text content of the email

fromstring

Optional. Omit it to send from the project's default sender. An address picks one of the project's verified senders (Hosting > Email); a display name (no @) renames the sender on a verified custom domain. Any other value is ignored and reported in warning — it never fails the send.

replyTostring email

Reply-to email address

Example request

{
  "subject": "Welcome to our service!",
  "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
  "text": "Welcome! Thanks for signing up.",
  "from": "support@mail.yourdomain.com",
  "replyTo": "support@example.com",
  "attachments": [
    {
      "filename": "report.pdf",
      "type": "application/pdf",
      "url": "https://example.com/files/report.pdf"
    }
  ]
}

Response

Email sent successfully

successboolean

Whether the email was sent successfully

messageIdstring

Unique message ID from the email provider

fromstring email

Actual sender email address used

tostring[]

List of recipient email addresses

subjectstring

Email subject line

timestampstring date-time

When the email was sent

warningstring

Present when part of the request was ignored, e.g. a from address that is not a verified sender for the project.

Example response

{
  "success": true,
  "messageId": "<20231201120000.1.ABC123@abc12345.blink-email.com>",
  "from": "noreply@abc12345.blink-email.com",
  "to": [
    "user@example.com"
  ],
  "subject": "Welcome to our service!",
  "timestamp": "2023-12-01T12:00:00.000Z",
  "warning": "\"from\" \"noreply@example.com\" is not a verified sender for this project, so it was ignored and the email was sent from the project's default sender. Add the sender in Hosting > Email, or omit \"from\"."
}

Changes

No recorded changes to this operation across all 1 revision of this API.