Send Regular Mail¶
Send regular emails through the specified Email address. When the Email sending request is sent successfully, the request will be added into the message queue, and users will receive an eventId to query the actual sending results.
Request Format¶
POST https://{apigw-address}/notification-center-service/v2.0/simple/email
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
The OU ID. How to get orgId >> |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
toAddresses |
Required |
List<String> |
List of recipients’ email addresses. |
senderCode |
Required |
String |
Sender address ID, used to specify which mailbox this email is sent through. You can select Notification Management > Messages > Configurations > Mail page in EnOS Management Console to view it. If this parameter is empty, the Email will be sent through the Notice email channel by default. |
subject |
Required |
String |
Email title. |
content |
Required |
String |
Content of the Email. |
ccAddresses |
Optional |
List<String> |
Address list when you need to add a copy of the email. |
priority |
Optional |
Enum |
Message sending priority, default P2, no special configuration required. |
Response Parameter¶
Name |
Required/Optional |
Data Type |
Description |
eventId |
Required |
String |
After you send an email or SMS request, you can use the eventId to query the results. |
Error Code¶
Code |
Error Message |
Description |
32404 |
email address is not present in this organization |
The sender’s email address does not exist |
32404 |
email template is not exist |
Email template does not exist |
32400 |
variable not in template |
Custom variable error in template |
32400 |
the format of mail address is illegal |
The recipient’s email(CC email) address format is incorrect |
32535 |
fail to authenticate the smtp server |
Smtp server authentication failed |
Sample¶
Request Example¶
url: https://{apigw-address}/notification-center-service/v2.0/simple/email?orgId=yourOrgId
method: POST
requestBody:
{
"ccAddresses": [],
"priority": "P2",
"toAddresses": [
"xxx@univers.com"
],
"senderCode": "NOTICE_GW",
"subject": "mail subject",
"content": "mail content"
}
Return Example¶
{"code":0, "msg":"OK", "submsg":"", "requestId": null, "data":{"eventId": "evt16062008765401}}
Exception Example¶
{"code":32403, "msg":"the quota is run out, test quota is limited", "submsg":"Permission denied: tunnel.quota.run.out", "data": null, "requestId": null}