Requirements
- E-goi Account with one of the following plans: Base, Pro, or Corporate
- Active API Key
- Active Transactional Service
- Valid Mobile Phone Sender (for SMS sending)
- Valid Email Sender (for email sending)
Priority Management in Transactional Sending
Overview
The priority management feature allows controlling the processing order and sending different types of messages (Email Single, Email Bulk, SMS Single and SMS Bulk). This is crucial to ensure that urgent messages are delivered immediately, while less urgent ones can be sent later.
Priority Fields
The transactional API allows defining the priority of messages through the "priority":
field. The available options are:
Priority | Description |
---|---|
“urgent” | Used for messages that must be delivered as quickly as possible. |
“high” | For messages that are important but not as critical as urgent. |
“normal” | The default priority level for most messages. |
“non-urgent” | For messages that can be sent with less urgency. |
Use Cases for Implementing Priority in Messages
Use Case 1: Sending Service Notifications (Urgent Priority)
Scenario: Your service is down, and you need to notify users immediately.
Configuration:
- Message Type: SMS
- Priority: urgent
URL Send Single SMS: https://slingshot.egoiapp.com/api/v2/sms/messages/action/send/single
Payload Example:
{
"to": "351-987654321",
"from": "1234",
"textBody": "Here's a bunch of props to you, {{ name }}, enjoy!",
"encoding": "unicode",
"maxCount": 1,
"mergeTags": [
"name:John Doe"
],
"priority": "urgent",
"customData": "meta-data, my relevant metadata",
"registered": false,
"group": "welcome",
"scheduleTo": "yyyy-MM-dd HH:mm:ss"
}
Example Response:
{
"messageId": "1234"
}
Explanation: By setting the priority to “urgent,” this SMS notification is marked for immediate delivery, ensuring that users are quickly informed about the service outage. This configuration helps to minimize downtime impact by delivering critical updates without delay.
Use Case 2: Sending Transactional Emails (High Priority)
Scenario: A user just registered on your site, and you need to send a confirmation email.
Configuration:
- Message Type: Email
- Priority: high
URL Send Single Email: https://slingshot.egoiapp.com/api/v2/email/messages/action/send/single
Payload Example:
{
"domain": "e-goi.com",
"senderId": "1234",
"senderName": "Customer Support",
"to": "john-doe@email.com",
"cc": [
"interested-person1@email.com"
],
"bcc": [
"interested-person2@email.com"
],
"subject": "Welcome to the Club",
"htmlBody": "Hello %name%! <b>Welcome!</b> ",
"textBody": "Hello %name%! Welcome! ",
"openTracking": true,
"clickTracking": true,
"mergeTags": [
"name:John Doe"
],
"customData": "meta-data, my relevant metadata",
"priority": "high",
"registered": false,
"header": {
"listUnsubscribe": true,
"optInIpAddress": "192.168.99.100"
},
"group": "welcome",
"scheduleTo": "yyyy-MM-dd HH:mm:ss",
"replyTo": {
"name": "egoi",
"email": "egoi@e-goi.com"
},
"snippet": "string"
}
Example Response:
{
"messageId": "1234"
}
Explanation: Setting the priority to “high” ensures that the confirmation email is sent promptly to users who have just registered. This helps in providing immediate feedback and a seamless user experience by acknowledging their registration without unnecessary delays.
Use Case 3: Low Urgency Marketing Campaign
Scenario: You are sending a monthly newsletter.
Configuration:
- Message Type: Email Bulk
- Priority: non-urgent
URL Send Bulk Email: https://slingshot.egoiapp.com/api/v2/email/messages/action/send/bulk
Payload Example:
[
{
"domain": "e-goi.com",
"senderId": "1234",
"senderName": "Customer Support",
"to": [
"john-doe@email.com"
],
"subject": "Monthly Newsletter",
"htmlBody": "Hello %name%! <b>Here's our latest news!</b> ",
"textBody": "Hello %name%! Here's our latest news! ",
"mergeTags": [
"name:John Doe"
],
"customData": "meta-data, my relevant metadata",
"priority": "non-urgent",
"registered": false,
"header": {
"listUnsubscribe": true,
"optInIpAddress": "192.168.99.100"
},
"group": "newsletter",
"scheduleTo": "yyyy-MM-dd HH:mm:ss",
"replyTo": {
"name": "egoi",
"email": "egoi@e-goi.com"
},
"snippet": "string"
},
{
"domain": "e-goi.com",
"senderId": "1234",
"senderName": "Customer Support",
"to": [
"john-doe2@email.com"
],
"subject": "Monthly Newsletter",
"htmlBody": "Hello %name%! <b>Here's our latest news!</b> ",
"textBody": "Hello %name%! Here's our latest news! ",
"mergeTags": [
"name:John Doe Second"
],
"customData": "meta-data, my relevant metadata",
"priority": "non-urgent",
"registered": false,
"header": {
"listUnsubscribe": true,
"optInIpAddress": "192.168.99.100"
},
"group": "newsletter",
"scheduleTo": "yyyy-MM-dd HH:mm:ss",
"replyTo": {
"name": "egoi",
"email": "egoi@e-goi.com"
},
"snippet": "string"
}
]
Example Response:
{
Just Respond Status: 204 - No content
}
Explanation: Setting the priority to “non-urgent” for the monthly newsletter ensures that it is sent at a less critical time. This allows you to manage your message queue effectively while still delivering the newsletter to your audience in a timely manner.
Use Case 4: Flash Sale Promotion (High Priority)
Scenario: You are running a time-limited sale promotion and need to notify customers quickly.
Configuration:
- Message Type: SMS
- Priority: high
URL Send Bulk SMS: https://slingshot.egoiapp.com/api/v2/sms/messages/action/send/bulk
Payload Example:
[
{
"to": "351-900000001",
"from": "1234",
"textBody": "Don't miss our flash sale! Hurry, limited time only!",
"encoding": "unicode",
"maxCount": 1,
"priority": "high",
"customData": "meta-data, my relevant metadata",
"registered": false,
"group": "flash-sale",
"scheduleTo": "yyyy-MM-dd HH:mm:ss",
"callBackUrl": "string"
},
{
"to": "351-900000002",
"from": "1234",
"textBody": "Don't miss our flash sale! Hurry, limited time only!",
"encoding": "unicode",
"maxCount": 1,
"priority": "high",
"customData": "meta-data, my relevant metadata",
"registered": false,
"group": "flash-sale",
"scheduleTo": "yyyy-MM-dd HH:mm:ss",
"callBackUrl": "string"
}
]
Example Response:
{
Just Respond Status: 204 - No content
}
Explanation: Setting the priority to “high” for flash sale promotions ensures that the message reaches customers quickly. This is crucial for time-sensitive notifications, helping maximize the impact of your promotion by ensuring timely delivery.
Additional Notes
- By default: Transactional emails should be sent with “normal” priority and marketing emails with “non-urgent” priority.
- Priority Codes: The processing order is affected only by priority; the sending speed within the same priority is handled FIFO (First In, First Out) for “non-urgent” and “normal,” and LIFO (Last In, First Out) for “urgent” and “high.”
Final Considerations
Proper use of priorities helps ensure that your messages are delivered at the right time, according to their importance. Remember to configure priorities carefully to avoid unnecessary delays in critical messages.