TransactionalEmail
Endpoint for configuring transactional emails
This endpoint lets you configure transactional emails (emails sent when a shipment's status changes) on your own.
Rules are tied to the user making the call and can be configured for the client_ids (or invoiced_client_ids) that the user can manage. If two rules for the same client_id overlap on the same courier and the same status, an error is returned for the second rule being inserted.
Emails can be sent through the mailchimp or gsped engine (check with Gsped what the differences are and how to obtain any configuration parameters).
Retrieve a single rule, or all rules if no [ID] is specified
GET https://api.gsped.it/[INSTANCE]/transactionalEmail/[ID]
For the description of the response fields, refer to the POST method
Path Parameters
ID
Numeric
ID of the single rule to retrieve
Headers
x-api-key*
String
APIKEY provided by Gsped
{
"result": [
{
"id": "1",
"user_id": "6",
"client_id": "390",
"config": {
"descrizione": "Regola test",
"sender_commercial_name": "",
"order_type_reference": "ddt_alpha",
"motore": "gsped",
"from": "noreply@gsped.com",
"to":"",
"cc": "",
"bcc": "",
"subject": "Oggetto della mail",
"corrieri": [
1
],
"statuses": [
17,
17.4,
17.5,
18
],
"dominio_validato": true,
"logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
}
},
{
"id": "2",
"user_id": "6",
"client_id": "391",
"config": {
"descrizione": "Template di test per tutti",
"sender_commercial_name": "",
"order_type_reference": "ddt_num",
"motore": "mailchimp",
"bcc": "",
"cc": "",
"from": "noreply@gsped.com",
"subject": "Mail di test da Gsped",
"corrieri": [
1,
2
],
"statuses": [
19
],
"apikey": "XXXXXXXXXXX",
"template_slug": {
"*": "test-2",
"IT": "test"
},
"dominio_validato": false
}
},
{
...
},
{
...
}
],
"code": 200
}Create a new rule
POST https://api.gsped.it/[INSTANCE]/transactionalEmail
Headers
x-api-key*
String
APIKEY provided by Gsped
Request Body
client_id*
Numeric
The client_id the rule applies to
config*
Object
The configuration container for this client_id (the following parameters must be part of this key)
sender_commercial_name
String
Associated template key:
Trade name (optional) to enter, displayed before the logo
in the email template.
order_type_reference*
NotBlank
Choice([
'ddt_num',
'ddt_alpha'
])
Associated template keys:
REQUIRED
Order reference type (mandatory choice) to enter, displayed with the shipment status text in the email template.
dominio_validato
bool
REQUIRED only for the gsped engine Indicates whether the domain has its DNS records configured according to Gsped's instructions for setting up a custom sender email. If false, emails are sent from noreply@gsped.com; if true, you can customise the from field.
motore*
String
Email sending engine Possible values: - gsped - mailchimp
logo
String
REQUIRED only for the gsped engine Base64 of a png image of max 300x300px to be used in the templates
from*
String
Email address shown as the sender of the transactional email
cc
String
Optional email address in copy
bcc
String
Optional email address in blind copy
descrizione*
String
Description of the rule and what it does
subject*
String
Email subject
apikey
String
REQUIRED only for the mailchimp engine The API key for the connection with mailchimp
template_slug
Object
REQUIRED only for the mailchimp engine. Key=>value object mapping recipient_country=>template_slug among those created in mailchimp. You can use the * character as the country to indicate the "rest of the world", i.e. to use the associated template if no matching country is found among those configured.
to
String
Email address used to ALWAYS FORCE sending to a fixed email address instead of the shipment recipient's email
Edit an existing rule
PUT https://api.gsped.it/[INSTANCE]/transactionalEmail/[ID]
Path Parameters
ID*
String
ID of the rule to edit
Headers
x-api-key*
String
APIKEY provided by Gsped
Request Body
client_id*
Numeric
The client_id the rule applies to
config*
Object
The configuration container for this client_id (the following parameters must be part of this key)
sender_commercial_name
String
Associated template key:
Trade name (optional) to enter, displayed before the logo
in the email template.
order_type_reference*
NotBlank
Choice([
'ddt_num',
'ddt_alpha'
])
Associated template keys:
REQUIRED
Order reference type (mandatory choice) to enter, displayed with the shipment status text in the email template.
dominio_validato
bool
REQUIRED only for the gsped engine Indicates whether the domain has its DNS records configured according to Gsped's instructions for setting up a custom sender email. If false, emails are sent from noreply@gsped.com; if true, you can customise the from field.
motore*
String
Email sending engine Possible values: - gsped - mailchimp
logo
String
REQUIRED only for the gsped engine Base64 of a png image of max 300x300px to be used in the templates
from*
String
Email address shown as the sender of the transactional email
cc
String
Optional email address in copy
bcc
String
Optional email address in blind copy
descrizione*
String
Description of the rule and what it does
subject*
String
Email subject
apikey
String
REQUIRED only for the mailchimp engine The API key for the connection with mailchimp
template_slug
Object
REQUIRED only for the mailchimp engine. Key=>value object mapping recipient_country=>template_slug among those created in mailchimp. You can use the * character as the country to indicate the "rest of the world", i.e. to use the associated template if no matching country is found among those configured.
to
String
Email address used to ALWAYS FORCE sending to a fixed email address instead of the shipment recipient's email
Delete the rule specified by [ID]
DELETE https://api.gsped.it/[INSTANCE]/transactionalEmail/[ID]
Path Parameters
ID*
Numeric
ID of the rule to delete
Headers
x-api-key*
String
APIKEY provided by Gsped
