Skip to main content

Documentation Portal

Sending Bulk Emails

Sending Bulk Emails

Emails can now be sent to multiple addresses by issuing an API call providing order IDs and the email message type. Additionally, placeholders can be added to the mail message to dynamically add details to the email message content without code changes.

This API provides the following:

  • Allow the merchant to send CS emails (Bulk Emails) on a single API by providing a list of order IDs

  • Allow the merchant to specify the email address for sending the processing report

  • Allow merchant the option to specify the return address, default as configured for CS/FinOps

  • Monitor and log merchant actions

  • Store the action results report for performance and success level measurements.

  • Customize the email message template for full merchant customizations and look & feel

Prerequisites

The following is to be prepared Before issuing the API:

  • Select the email type and verify its template, from the existing types, or ask your CSM to create a template.

  • Specify the placeholders' name and value, if you plan to add them to the email message.

  • List the Order IDs that are the addressees of this mail.

Implementation

Method/URL

POST https://{server_name}/emails

Parameters

Request Path Parameters

None

Request Body Parameters

Parameter

Type

Description

Mandatory?

emailTypeName

string

Specifies the name of the email type and its related HTML template.

Yes

senderEmailAddress

string

The mail address of the sender that the addressee sees. The default sender mail address is [email protected] or

other mail specified by the merchant.

Yes

reportToEmailAddress

string

The merchant’s email address to receive the bulk sending report.

Yes

orderIds

Array of strings

The list of addressees, by their Order ID.

Yes

Placeholders

List of objects

A list of placeholders and their value source. Each object contains:

  • Placeholder Name

  • Value – A Fixed value or text resource value**

No

** Note: A text resource value refers to predefined placeholders and their related values. The placeholders and their values are defined in the Admin platform, with the prefix TR_. A value can be a Global-e default value or merchant-specific value. Refer to your CSM for all predefined TR_ placeholders, and for defining merchant-specific values.

Response Parameters

None

Example

POST https://{server_name}/emails

{
"orderIds": [
"GE399999999GB"],
"placeholders": {
"{DelayReason}": "TR_OverloadDelayReason",
"{DelayDaysCount}": "2"
"senderEmailAddress": "[email protected]",
"emailTypeName": "Delayedfulfillment",
"reportToEmailAddress": "[email protected]"
}

Response

{
"Processing is in progress. You will get an email after the process is complete."
}

Email Examples

Mail Message

In the following example, the Order ID is integrated into the email template, by adding the orderId placeholder.

image1.png

Note: When sending a list of Order IDs in the API request, each mail message will have the relevant ID for the mail recipient.

Results Report email

The following report is received detailing the result of the bulk emails API, sent to inform of a delayed fulfillment of a single order ID.

image2.png

Return Codes

The returned error codes are as follows:

#

Code

Description

400

The following descriptions can be returned:

  • "At least one order ID must be provided."

  • "The sender's email address is incorrect."

  • "The SenderEmailAddress must be a valid email address."

  • "The EmailTypeName must be provided."

  • "Custom email type is not defined. Please contact Global-E support."

  • "The ReportToEmailAddress must be a valid email address."

Prerequisites

The following is to be prepared Before issuing the API:

  • Select the email type and verify its template, from the existing types, or ask your CSM to create a template.

  • Specify the placeholders' name and value, if you plan to add them to the email message.

  • List the Order IDs that are the addressees of this mail.

Implementation

Method/URL

POST https://{globale_api_domain}/emails
Parameters

Request Path Parameters

None

Request Body Parameters

Parameter

Type

Description

Mandatory?

emailTypeName

string

Specifies the name of the email type and its related HTML template.

Yes

senderEmailAddress

string

The mail address of the sender that the addressee sees. The default sender mail address is [email protected] or

other mail specified by the merchant.

Yes

reportToEmailAddress

string

The merchant’s email address to receive the bulk sending report.

Yes

orderIds

Array of strings

The list of addressees, by their Order ID.

Yes

Placeholders

List of objects

A list of placeholders and their value source. Each object contains:

  • Placeholder Name

  • Value – A Fixed value or text resource value**

No

** Note: A text resource value refers to predefined placeholders and their related values. The placeholders and their values are defined in the Admin platform, with the prefix TR_. A value can be a Global-e default value or merchant-specific value. Refer to your CSM for all predefined TR_ placeholders, and for defining merchant-specific values.

Response Parameters

None

Example

POST https://{server_name}/emails

Request

{

"orderIds": [

"GE399999999GB"

],

"placeholders": {

"{DelayReason}": "TR_OverloadDelayReason",

"{DelayDaysCount}": "2"

"senderEmailAddress": "[email protected]",

"emailTypeName": "Delayedfulfillment",

"reportToEmailAddress": "[email protected]"

}

Response

{ "Processing is in progress. You will get an email after the process is complete." }

Email Examples

Mail Message

In the following example, the Order ID is integrated into the email template, by adding the orderId placeholder.

image1.png

Note: When sending a list of Order IDs in the API request, each mail message will have the relevant ID for the mail recipient.

Results Report email

The following report is received detailing the result of the bulk emails API, sent to inform of a delayed fulfillment of a single order ID.

image2.png
Return Codes

The returned error codes are as follows:

Code

Description

400

The following descriptions can be returned:

  • "At least one order ID must be provided."

  • "The sender's email address is incorrect."

  • "The SenderEmailAddress must be a valid email address."

  • "The EmailTypeName must be provided."

  • "Custom email type is not defined. Please contact Global-E support."

  • "The ReportToEmailAddress must be a valid email address."