Skip to main content

Features

  • Send emails to any recipient with a custom subject and message.
  • Attach files as Blob or File objects.
  • Authorization token support for secure API calls.

Function Overview

The sendEmailAsync function sends an email using a POST request to the email service endpoint. It supports the following parameters:

Parameters

ParameterTypeRequiredDescription
tostringYesRecipient’s email address.
subjectstringYesSubject of the email.
messagestringYesBody of the email.
fromstringNoSender’s email address. Defaults to the configured sender address.
attachmentsArray of objectsNoList of attachments to include in the email.
Attachment Object Each attachment in the attachments array should have the following properties:
PropertyTypeRequiredDescription
filenamestringYesThe name of the file to be attached.
fileBlob or FileYesThe binary content of the file.

Usage Example

1. Sending an Email Without Attachments

2. Sending an Email with Attachments using Blob file

3. Sending an Email with Attachments using Binary Content

Documentation for Sending Emails with Base64 Attachments (backend, hooks)

This guide explains how to use the sendEmail function to send emails with PDF attachments in base64 format.