Technical Services
Non Insurance Services
SNS Components
Email Service
Sidebar On this page

Introduction

Our email service is a connector to SMTP-based email server and SendGrid email service. It supports sending out emails with a plain text body or attachment in a business scenario like policy issuance. The manual and restful APIs are provided for user.

Usage Scenarios

Email service is designed to help digital marketers and application developers send marketing, notifications, and business emails. It is a reliable, economical, and practical service for enterprises of all sizes that contact customers with email. The user can configure their own email account before using the service.

Apply for an email sender

If you need to apply for an email sender of your own domain with aws ses, the following table shows the information you need to fill in.

TitleExampleDescription
Project Code1234567 XXX project
Email Sender Address / @Domainxxx@insuremo.com / @your-domain.comThe email address you want to send from
Site / EnvptdevThe site or environment that the email will send from
Type of emailSend to policy holder after issuingBriefly describe the type of email your will send
Quotas100 emails per dayExpect number of emails sent per day
Other requirementsNoneSuch as configuration set rules, DKIM, SPF, specify the region…
note

If you need to add configurations such as DKIM or SPF to prevent being identified as spam by the recipient, please verify your domain.

Basic UI Operations

Entrance

  1. Log in to insureMO Portal with your personal account.
tip

If you don’t have insureMO personal account, click Sign Up to register one. Then log in to the portal.

  1. Click Catalog at the top of the home page.

  2. In the left panel of the Catalog page, navigate to Non Insurance Services > Communications.

  3. Find EMail Service card. You will see API Details and Settings.
    email-card
    a. API Details will give you direct access to the APIs listed in it.
    api-details
    b. For creation and other actions, you need to click Setting to go to the Email Management page.
    email-setting
    c. This will navigate to the main email settings page where you can manage the service.
    email-page

Account Management

Create

  • Click Create on the email service console.
account-create_01
  • Register your email account. Click Submit. It will be saved and appear in the list in the main page.
account-create_02

Edit

  • Click Edit on the email service console.
account-edit

Delete

  • Click Delete against a particular record to delete the account.
account-delete
note

After confirming deletion, the account will not continue to be used. Before deleting the account, make sure that the account is no longer used by the application.

Share

  • Click Share to share the current configuration of email account operator with other tenants.
account-share_01 account-share_02

Test

  • After the account is created successfully, you can verify whether the current account is available through a test email. If available, the receiver will receive the following test email.
account-test_01 account-test_02 account-test_03

Blacklist Management

  • If there is a recipient in the blacklist, the email address of the recipient will be invalid, and all accounts in the mail service cannot send email to the recipient.
blacklist-page

Create

  • Click Create on the Blacklist management page.
blacklist-create_01 blacklist-create_02

Delete

• Click Delete to remove the email address from the blacklist.

blacklist-delete

Template Management

• Configure the email content Template to automatically send notifications.

template-page

Create

• Click Create on the Template management page.

template-create_01 template-create_02
note

Template Content Restriction Description

  • The variable names can only be filled in with English letters or combination of English letters and numbers. The first variable name cannot be number, and the other cannot be the following string: email, mobile, id, nick, site.
  • When sending emails, the variable content can neither be empty, nor contain any symbols. The content length should be less than 16 characters.
  • [ ] is not allowed to be added to the beginning or the end of the email template.
  • If there is a URL in the template, it must be an ICP-filing URL.
  • The content cannot include marketing, loans, jackpot, lottery, party and government, religious promotion and other related information.
  • The notification email and promotional email don’t support the finance, financial management, real estate and other related content.
  • The email content cannot contain politically sensitive words and vulgar sensitive words.
  • The template cannot just contain ${}. Please specify the structure of the message content.
  • The email templates do not support special symbols.

Log

• You can view the log files in the Audit Service, they are available for a particular day and can be downloaded as well. This is required for audit purpose and to check if there is any issue in the service.

log-page

Developing with Email Service

Send Email

Calling REST APIs

For all API list, see insureMO API Reference - email.

After the mail account is configured by the tenant, the tenant can call the API to send emails.

note

Restriction Description

  • We will monitor the content of emails sent by users to prevent it from violating the requirements of national laws and regulations.

  • If the message content violates the rules, the relevant users will be frozen. After the account is frozen, the user cannot continue to use the mail service.

Authentication

HTTP Authentication, scheme: bearer

POST SendEmail

API URLMethod
https://[HOST]/mo-fo/1.0/sns/email/sendPOST
  • Header
ParameterValue
AuthorizationBearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Body Parameters

{
"account_name": "insuremo@insuremo.com",
"alias": "insureMO",
"attachments": [
{
"content": "string",
"content_id": "string",
"headers": {
"property1": "string",
"property2": "string"
},
"mime_type": "string"
}
],
"auto_format_html": false,
"bcc": [
"sample@insuremo.com"
],
"cc": [
"sample@insuremo.com"
],
"content": "string",
"content_type": "text/html",
"custom_headers": {
"property1": "string",
"property2": "string"
},
"priority": false,
"reply_to": "string",
"sender_params": {
"property1": "string",
"property2": "string"
},
"subject": "Email Service Testing Email",
"template_code": "string",
"template_params": {
"property1": "string",
"property2": "string"
},
"to": [
"sample@insuremo.com"
]
}

Response Examples

If the code is “i_common_success”, it indicates successful sending. Otherwise, the sending fails.

{
"code": "i_common_success",
"data": {
"content_length": 0,
"data": "string",
"message_id": "string"
},
"message": "string",
"message_params": [
"string"
],
"trace_id": "string"
}

Using insureMO Email SDK For Java

Please refer to this document: Welcome to insureMO SDK for Java.

Code example:

import com.insuremo.sdk.core.exception.ApiException;
import com.insuremo.sdk.services.sns.SnsSdkClient;
import com.insuremo.sdk.services.sns.api.EmailApi;
import com.insuremo.sdk.services.sns.bundle.SendEmailResponseBundle;
import com.insuremo.sdk.services.sns.model.SendEmailRequest;

public class EmailApi_sendEmail {

public static void main(SnsSdkClient snsSdkClient) {
System.out.println("----- Example for EmailApi.sendEmail -----");
EmailApi emailApi = snsSdkClient.emailApi();

System.out.println("----- sendEmail -----");

try {
SendEmailResponseBundle responseBundle = emailApi.newSendEmailRequestBuilder()
.sendEmailRequest(new SendEmailRequest().
accountName("portal-test@insuremo.com").
subject("email testing").
content("This is a testing email").
addToItem("sdk-test@simulator.insuremo.com"))
.doRequest();
System.out.println(responseBundle.getBody().getData());
} catch (ApiException e) {
System.out.println(e.getResponseBody());
System.out.println(e.getCode());
}
System.out.println("----- Done. -----");
}
}

Send 2FA Email (Verify Code)

Please see Send An MFA Code via Email.

Migrate to SNS API

Send Email

API:

https://[host]/eBao/1.0/email/send

=>

https://[host]/mo-fo/1.0/sns/email/send

Request Body:
/eBao/1.0/email/send/mo-fo/1.0/sns/email/sendData TypeDifference
accountaccount_namestring
aliasaliasstring
attachmentattachmentsarray/Object
attachment.attachmentContentattachments.contentstring/byte
attachment.attachmentMimeTypeattachments.mime_typestring
attachment.attachmentNameattachments.content_idstring
autoformat-boolDeperated field. You should specify email content type as html(default) or text and format the content.
bccbccarray/string
ccccarray/string
consigneetoarray/string
contentcontentstring
contentTypecontent_typestring
contentFilesattachmentsarray/ObjectSame as attachment
contentFiles.attachmentContentattachments.contentstring/byte
contentFiles.attachmentMimeTypeattachments.mime_typestring
contentFiles.contentIdattachments.content_idstring
contentFiles.headersattachments.headersmap/string
customHeaderscustom_headersmap/string
priorityprioritybool
replytoreply_tostring
subjectsubjectstring
templateCodetemplate_codestring
templateParamstemplate_params
sender_params
map/stringSplit into two different parameters.
template_params is used for value replacement in templates and will not be recorded in audit logs.
sender_params specifies the parameters for sending the email and will be recorded in audit logs.
Response:

/eBao/1.0/email/send

Success Response:

HTTP Status Code: 200

{
"body": "abcd1234-ab12-cd34-ac13-abcd1234abcd",
"info": "abcd1234-ab12-cd34-ac13-abcd1234abcd",
"status": 0
}

Failed Response:

HTTP Status Code: 200

{
"body": null,
"info": "error message",
"message": "error message",
"status": 1
}

=>

/mo-fo/1.0/sns/email/send

Success Response:

HTTP Status Code: 200

{
"code": "i_common_success",
"data": {
"content_length": 0,
"data": "string",
"message_id": "string"
},
"trace_id": "string"
}

Failed Response:

HTTP Status Code: 499 / 599

{
"code": "e_sns_email_error_code",
"message": "string",
"message_params": [
"string"
],
"trace_id": "string"
}

FAQs

Q: What email can I send?

A: Triggered email: Emails triggered by events, such as registration notification, transaction notification, and verification notification emails.

Batch email: Subscription emails sent to members, such as product promotion, user notification, periodical information. The email service only allows sending commercial emails permitted by the recipient. The mail content is the recipient’s active subscription. The unlicensed spam is not allowed to be sent.

Q: Can the attachments be added to email?

A: Yes, see API interface for more details.

Q: Why did all the emails go into the recipient’s junk mailbox?

A: It’s generally because the email content is judged as spam by the recipient’s system. Attempts can be made to adjust the email content and avoid the use of spam terms. Then send a test email to your other mailboxes to check if the new content is still considered as spam.

Q: Suggestions on Spam Handling

A: Standardize the email content and use the link address of website. Avoid using short link address. Otherwise, it will be regarded as spam.

Add the address of the unsubscribe link to the email content and perform the actual unsubscribe. At the same time, remind the recipient to add the sender’s address to the whitelist or to contact at a clear location. At the same time, add the introduction of your company and products.

If the sender sends the same message to multiple recipients at the same time, it may also be automatically identified as spam by the system.


Feedback
Was this page helpful?
|
Provide feedback