Deliverlies

最新の更新:2023-03-14

Regular delivery

URL

https://email.api.engagelab.cc/v1/mail/send
          https://email.api.engagelab.cc/v1/mail/send

        
このコードブロックは、フローティングウィンドウに表示されます

Content-Type:

Content-Type: application/json;charset=utf-8
          Content-Type: application/json;charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます

HTTP Request Method

POST
          POST

        
このコードブロックは、フローティングウィンドウに表示されます

Request Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Request Parameter

Parameter Type Required or not Description
from string yes From. Example:support@mail.engagelab.com,support<support@mail.engagelab.com>
to array[string] yes Recipient . Up to 100 addresses are supported. Example: ["xjm@hotmail.com","xjm2@gmail.com"]
body object yes Mail settings
custom_args object no Optional fields customized by the customer. The maximum size is 1KB.
request_id string no ID of this sending request; 128 characters maximum.

Body

Parameter Type Required or not Description
cc array[string] no Cc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
bcc array[string] no Bcc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
reply_to array[string] no Reply to . Up to 3 addresses are supported; If no value is transferred, the reply to address is from.
subject string yes Subject. 256 characters at most; Support variables, emoji.
content object yes Content
html string * Content of html. Format is text/html.
text string * Content of text . Format is text/plain.
preview_text string no Content preview
vars object no Variable. Up to 1MB;When send_mode=0 or send_mode=1, this parameter is valid.
label_id string no Label ID used for this sending
label_name string no Label name used for this sending
headers object no Headers . Up to 1KB.
attachments array[object] no Attachments . The total size shall not exceed 10MB.
content string yes Content of attachments. Base64 encoding.
filename string yes The attachment's filename,Example:news.pdf
disposition string yes Value can be attachment or inline.
content_id string no If the value of disposition is inline and the file type is image, you need to set this value
settings object no Send settings
send_mode int no Sending method. 0 means sending separately; 1 means broadcast sending, and all recipients will be displayed at the same time; 2 indicates that the address list is sent. The value of to is the address list's address. The default is 0
return_email_id boolean no Whether to return email ID, default is true .
sandbox boolean no Whether to use sandbox mode, the default is false. If it is true, the mail will not be delivered, and only the request parameters will be verified for validity .
notification boolean no Whether to use the read receipt, the default is false. The default receipt is from, which needs to be used together with the receiving route .
open_tracking boolean no Whether to enable open tracking, the default system setting value. When send_mode=0 or send_mode=1, this parameter is valid.
click_tracking boolean no Whether to enable click tracking, the default system setting . When send_mode=0 or send_mode=1, this parameter is valid.
unsubscribe_tracking boolean no Enable unsubscription or not. Default system setting. When send_mode=0 or send_mode=1, this parameter is valid.
unsubscribe_page_id array[int] no Customized unsubscribe page, default system setting value. When send_mode=0 or send_mode=1, this parameter is valid.

Tips:

  1. When send_mode=2, the value of to is an address list nickname, and the number cannot exceed 5. In this case, the parameters cc and bcc are invalid.

  2. Html and plain cannot be empty at the same time.

  3. Preview_text can only be used with html. If no html value is transferred, preview_text will not take effect.

  4. Vars is used for variable replacement of mail content. The format is json object, and the format is' {"varname": ["value1," value2 "]} ', where varname is the mail content variable.

    Message content: Dear %name%, welcome to %sp% email service. Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]} Email content replacement: Dear Mike, welcome to engagelab email service.
              Message content: Dear %name%, welcome to %sp% email service.
    
    Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]}
    
    Email content replacement: Dear Mike, welcome to engagelab email service.
    
            
    このコードブロックは、フローティングウィンドウに表示されます
  5. Users can pass either the 'label_id' or the 'label_name' for this transmission. If the 'label_name' does not exist, the system will automatically create it. If both 'label_id' and 'label_name' are passed, the 'label_name' will be ignored.

  6. Headers is used to customize the header field of the message. The format is json object, and the format is' {"User Define": "123", "User Custom": "abc"} '. However, the key string cannot contain the following values (case insensitive) DKIM-Signature ,Received ,Sender ,Date ,From ,To ,Reply-To ,Cc ,Bcc ,Subject ,Content-Type , Content-Transfer-Encoding ,X-SENDCLOUD-UUID ,X-SENDCLOUD-LOG ,X-Remote-Web-IP ,X-SMTPAPI, Return-Path,X-SENDCLOUD-LOG-NEW

  7. When disposition is set to inline, the attachment content is an image, and the attachment will be rendered and displayed directly in the message body as an inline image. The content_id must be set and a unique string, which is used as the src when the picture is displayed in the message body.

Email content: <html> <img src="cid:image_1000"></img> <img src="cid:image_1001"></img> </html> attachments parameter: [ {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"}, {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"}, ]
              Email content:
    <html>
        <img src="cid:image_1000"></img>
        <img src="cid:image_1001"></img>
    </html>
    
    attachments parameter:
    [
      {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"},
      {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"},
    ]

        
このコードブロックは、フローティングウィンドウに表示されます
  1. As customer_args defined by yourself, will be embedded in the header; The subsequent WebHook data will be returned to you.
  2. The request_id is to prevent repeated submission, and the validity period is 1 hour. If it is submitted repeatedly within 1 hour, the last request result will be returned.
  3. The total email size cannot exceed 70MB.

Request Example

curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' --data '{ "from": "EngageLab Newsletter <newsletter@mail.engagelab.com>", "to": ["111@qq.com", "222<222@qq.com>"], "body": { "cc": ["noreply@mail.engagelab.com"], "bcc": ["intern<intern@mail.engagelab.com>"], "reply_to": ["reply@mail.engagelab.com"], "subject": "%date% Newsletter ", "content": { "html": "<a href=\"https://www.engagelab.com\">Newsletter %kkk%</a>", "text": "Today's news is %ttt%", "preview_text": "preview_text is ..." }, "vars": { }, "label_id": 100233, "label_name": "", "headers": {}, "attachments": [{ "content": "The Base64 encoded content of the attachment", "type": "text/html", "filename": "The attachment's filename", "disposition": "inline | attachment", "content_id": "" }], "settings": { "send_mode": 0, "return_email_id": true, "sandbox": true, "notification": false, "open_tracking": true, "click_tracking": false, "unsubscribe_tracking": true, "unsubscribe_page_id": [1,2] } }, "custom_args": {}, "request_id": "" }' 'https://email.api.engagelab.cc/v1/mail/send'
          curl -X POST -H 'Content-Type: application/json; charset=utf-8' 
     -H 'Authorization: YXBpX3VzZXI6YXBpX2tleQ==' 
     --data '{
  "from": "EngageLab Newsletter <newsletter@mail.engagelab.com>", 
  "to": ["111@qq.com", "222<222@qq.com>"],
  "body": {
      "cc": ["noreply@mail.engagelab.com"],                            
      "bcc": ["intern<intern@mail.engagelab.com>"],                  
      "reply_to": ["reply@mail.engagelab.com"],                         
      "subject": "%date% Newsletter ",                                       
      "content": {                                                     
        "html": "<a href=\"https://www.engagelab.com\">Newsletter %kkk%</a>", 
        "text": "Today's news is %ttt%",                                      
        "preview_text": "preview_text is ..."                          
         },
      "vars": { },
      "label_id": 100233, 
      "label_name": "",
      "headers": {},
      "attachments": [{                                                
        "content": "The Base64 encoded content of the attachment",     
        "type": "text/html",
        "filename": "The attachment's filename",            
        "disposition": "inline | attachment",                           
        "content_id": ""  
      }],
      "settings": {                 
        "send_mode": 0, 
        "return_email_id": true,  
        "sandbox": true,
        "notification": false,
        "open_tracking": true,                                           
        "click_tracking": false,                                         
        "unsubscribe_tracking": true,                              
        "unsubscribe_page_id": [1,2]
      }
  },
  "custom_args": {},           
  "request_id": "" 
}'  'https://email.api.engagelab.cc/v1/mail/send' 

        
このコードブロックは、フローティングウィンドウに表示されます

Returned Value Example

  • Non address list sending (send_mode=0 or send_mode=1)

    Response-success

HTTP Status: 200

{ "email_ids":[ "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound0$111@qq.com", "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound1$222@qq.com"], "request_id":"" }
          {
"email_ids":[
      "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound0$111@qq.com",
      "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound1$222@qq.com"],
"request_id":""
}

        
このコードブロックは、フローティングウィンドウに表示されます

Response-error

HTTP Status :400

{ "code": 30801, "message": "From can not be empty" }
          {
    "code": 30801,
    "message": "From can not be empty"
}

        
このコードブロックは、フローティングウィンドウに表示されます
  • Address list sending (send_mode=2) Response-success

HTTP Status: 200

{ "task_id":[102923], "request_id":"" }
          {
"task_id":[102923],
"request_id":""
}

        
このコードブロックは、フローティングウィンドウに表示されます

Response-error

HTTP Status :400

{ "code": 30801, "message": "From can not be empty" }
          {
    "code": 30801,
    "message": "From can not be empty"
}

        
このコードブロックは、フローティングウィンドウに表示されます

Template delivery

URL

https://email.api.engagelab.cc/v1/mail/sendtemplate
          https://email.api.engagelab.cc/v1/mail/sendtemplate

        
このコードブロックは、フローティングウィンドウに表示されます

Content-Type:

Content-Type: application/json; charset=utf-8
          Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます

HTTP Request Method

POST
          POST

        
このコードブロックは、フローティングウィンドウに表示されます

Request Header

Header Type Required Description
Authorization String true Basic base64(api_user:api_key)

Request Parameter

Parameter Type required or not Description
from string yes From. Example:support@mail.engagelab.com,support<support@mail.engagelab.com>
to array[string] yes Recipient . Up to 100 addresses are supported. Example: ["xjm@hotmail.com","xjm2@gmail.com"]
body object yes Mail settings
custom_args object no Optional fields customized by the customer. The maximum size is 1KB.
request_id string no ID of this sending request; 128 characters maximum.

Body

Parameter Type required or not Description
cc array[string] no Cc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
bcc array[string] no Bcc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
reply_to array[string] no Reply to . Up to 3 addresses are supported; If no value is transferred, the reply to address is from.
subject string no Subject. 256 characters at most; Support variables, emoji.
template_invoke_name string yes Template invoke name.
vars object no Variable. Up to 1MB; When send_mode=0 or send_mode=1, this parameter is valid.
label_id string no Label ID used for this sending
label_name string no Label name used for this sending
headers object no Headers . Up to 1KB.
attachments array[object] no Attachments . The total size shall not exceed 10MB.
content string yes Content of attachments. Base64 encoding.
filename string yes The attachment's filename,Example:news.pdf
disposition string yes Value can be attachment or inline.
content_id string no If the value of disposition is inline and the file type is image, you need to set this value
settings object no Send settings
send_mode int no Sending method. 0 means sending separately; 1 means broadcast sending, and all recipients will be displayed at the same time; 2 indicates that the address list is sent. The value of to is the address list's address. The default is 0
return_email_id boolean no Whether to return email ID, default is true .
sandbox boolean no Whether to use sandbox mode, the default is false. If it is true, the mail will not be delivered, and only the request parameters will be verified for validity .
notification boolean no Whether to use the read receipt, the default is false. The default receipt is from, which needs to be used together with the receiving route .
open_tracking boolean no Whether to enable open tracking, the default system setting value. When send_mode=0 or send_mode=1, this parameter is valid.
click_tracking boolean no Whether to enable click tracking, the default system setting . When send_mode=0 or send_mode=1, this parameter is valid.
unsubscribe_tracking boolean no Enable unsubscription or not. Default system setting. When send_mode=0 or send_mode=1, this parameter is valid.
unsubscribe_page_id array[int] no Customized unsubscribe page, default system setting value. When send_mode=0 or send_mode=1, this parameter is valid.

Tips:

  1. When send_mode=2, the value of to is an address list nickname, and the number cannot exceed 5. In this case, the parameters cc and bcc are invalid.

  2. Vars is used for variable replacement of mail content. The format is json object, and the format is' {"varname": ["value1," value2 "]} ', where varname is the mail content variable.

    Message content: Dear %name%, welcome to %sp% email service. Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]} Email content replacement: Dear Mike, welcome to engagelab email service.
              Message content: Dear %name%, welcome to %sp% email service.
    
    Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]}
    
    Email content replacement: Dear Mike, welcome to engagelab email service.
    
            
    このコードブロックは、フローティングウィンドウに表示されます
  3. Users can pass either the 'label_id' or the 'label_name' for this transmission. If the 'label_name' does not exist, the system will automatically create it. If both 'label_id' and 'label_name' are passed, the 'label_name' will be ignored.

  4. Headers is used to customize the header field of the message. The format is json object, and the format is' {"User Define": "123", "User Custom": "abc"} '. However, the key string cannot contain the following values (case insensitive) DKIM-Signature ,Received ,Sender ,Date ,From ,To ,Reply-To ,Cc ,Bcc ,Subject ,Content-Type , Content-Transfer-Encoding ,X-SENDCLOUD-UUID ,X-SENDCLOUD-LOG ,X-Remote-Web-IP ,X-SMTPAPI, Return-Path,X-SENDCLOUD-LOG-NEW

  5. When disposition is set to inline, the attachment content is an image, and the attachment will be rendered and displayed directly in the message body as an inline image. The content_id must be set and a unique string, which is used as the src when the picture is displayed in the message body.

    Email content: <html> <img src="cid:image_1000"></img> <img src="cid:image_1001"></img> </html> attachments parameter: [ {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"}, {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"}, ]
              Email content:
    <html>
        <img src="cid:image_1000"></img>
        <img src="cid:image_1001"></img>
    </html>
    
    attachments parameter:
    [
      {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"},
      {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"},
    ]
    
            
    このコードブロックは、フローティングウィンドウに表示されます
  6. As customer_args defined by yourself, will be embedded in the header; The subsequent WebHook data will be returned to you.

  7. The request_id is to prevent repeated submission, and the validity period is 1 hour. If it is submitted repeatedly within 1 hour, the last request result will be returned.

  8. The total email size cannot exceed 70MB.

Returned Value Example

Template content(month_bill)

Dear %name%: Hello! Your consumption amount this month is: %money% .
          Dear %name%:
  Hello! Your consumption amount this month is: %money% .

        
このコードブロックは、フローティングウィンドウに表示されます

Regular delivery (call template month_bill )

curl -X POST "https://email.api.engagelab.cc/v1/mail/sendtemplate" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "from": "support@mail.engagelab.com", "to": ["xjmfc@126.com", "xjmfcme@gmail.com"], "body": { "subject": "test email", "template_invoke_name": "month_bill", "label_id": 10143, "label_name": "", "vars": { "%name%": ["jack", "jone"], "%money%": ["30", "50"] }, "headers": { "userdefine-tag-location": "us", "userdefine-tag-user": "fashion" }, "attachments": [{ "content": "The Base64 encoded content of the attachment", "filename": "The attachment's filename", "disposition": "inline | attachment", "content_id": "" }], "settings": { "send_mode": 0, "return_email_id": true, "sandbox": true, "notification": false, "open_tracking": true, "click_tracking": false, "unsubscribe_tracking": true, "unsubscribe_page_id": [1, 2] } }, "custom_args": {}, "request_id": "" }' #xjmfc@126.com received: Dear jack: Hello! Your consumption amount this month is: 30 . #--------------------------------------------------- # xjmfcme@gmail.com received: Dear Joe: Hello! Your consumption amount this month is: 50 .
          curl -X POST "https://email.api.engagelab.cc/v1/mail/sendtemplate" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
    "from": "support@mail.engagelab.com",
    "to": ["xjmfc@126.com", "xjmfcme@gmail.com"],
    "body": {
        "subject": "test email",
        "template_invoke_name": "month_bill",
        "label_id": 10143,
        "label_name": "",
        "vars": {
            "%name%": ["jack", "jone"],
            "%money%": ["30", "50"]
        },
        "headers": {
            "userdefine-tag-location": "us",
            "userdefine-tag-user": "fashion"
        },
        "attachments": [{
            "content": "The Base64 encoded content of the attachment",
            "filename": "The attachment's filename",
            "disposition": "inline | attachment",
            "content_id": ""
        }],
        "settings": {
            "send_mode": 0,
            "return_email_id": true,
            "sandbox": true,
            "notification": false,
            "open_tracking": true,
            "click_tracking": false,
            "unsubscribe_tracking": true,
            "unsubscribe_page_id": [1, 2]
        }
    },
    "custom_args": {},
    "request_id": ""
        
}'


#xjmfc@126.com received:
Dear jack:
    Hello! Your consumption amount this month is: 30 .
#---------------------------------------------------
# xjmfcme@gmail.com received:
Dear Joe:
  
    Hello! Your consumption amount this month is: 50 .

        
このコードブロックは、フローティングウィンドウに表示されます

Response-success

HTTP Status: 200

{ "email_ids":[ "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound0$xjmfc@126.com", "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound1$xjmfcme@gmail.com"], "request_id":"" }
          {
"email_ids":[
      "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound0$xjmfc@126.com",
      "1447054895514_15555555_32350_1350.sc-10_10_126_221-inbound1$xjmfcme@gmail.com"],
"request_id":""
}

        
このコードブロックは、フローティングウィンドウに表示されます

Response-error

HTTP Status :404

not found
          not found

        
このコードブロックは、フローティングウィンドウに表示されます

Regular delivery (call template month_bill, call address list users@maillist.email.engagelab.com)

curl -X POST "https://email.api.engagelab.cc/v1/mail/sendtemplate" --header "Authorization: Basic <<YOUR_API_KEY_HERE>>" --header "Content-Type: application/json" --data '{ "from":{"admin@engaelab.com"}, "to":["users@maillist.email.engagelab.com"], "body":{ "subject":"bill", "template_invoke_name":"month_bill", "label":"gangz" }}'
          curl -X POST "https://email.api.engagelab.cc/v1/mail/sendtemplate" 
--header "Authorization: Basic <<YOUR_API_KEY_HERE>>" 
--header "Content-Type: application/json" 
--data '{
        "from":{"admin@engaelab.com"},
        "to":["users@maillist.email.engagelab.com"],
        "body":{
            "subject":"bill",
             "template_invoke_name":"month_bill",
             "label":"gangz"
}}'

        
このコードブロックは、フローティングウィンドウに表示されます

Response-success

HTTP Status: 200

{ "task_id":[102923], "request_id":"" }
          {
"task_id":[102923],
"request_id":""
}

        
このコードブロックは、フローティングウィンドウに表示されます

Response-error

HTTP Status :404

not found
          not found

        
このコードブロックは、フローティングウィンドウに表示されます

Send meeting calendar

URL

https://email.api.engagelab.cc/v1/mail/sendcalendar
          https://email.api.engagelab.cc/v1/mail/sendcalendar

        
このコードブロックは、フローティングウィンドウに表示されます

Content-Type:

Content-Type: application/json; charset=utf-8
          Content-Type: application/json; charset=utf-8

        
このコードブロックは、フローティングウィンドウに表示されます

HTTP Request Method

POST
          POST

        
このコードブロックは、フローティングウィンドウに表示されます

Request Header

Header Type Required Description
Authorization String true Basic base64(apiUser:apiKey)

Request Parameter

Parameter Type Required or not Description
from string yes From. Example:support@mail.engagelab.com,support<support@mail.engagelab.com>
to array[string] yes Recipient . Up to 100 addresses are supported. Example: ["xjm@hotmail.com","xjm2@gmail.com"]
body object yes Mail settings
custom_args object no Optional fields customized by the customer. The maximum size is 1KB.
request_id string no ID of this sending request; 128 characters maximum.

Body

Parameter Type Required or not Description
cc array[string] no Cc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
bcc array[string] no Bcc. Maximum of 100 addresses are supported . Only when send_mode=1, this parameter is valid.
reply_to array[string] no Reply to . Up to 3 addresses are supported; If no value is transferred, the reply to address is from.
subject string yes Subject. 256 characters at most; Support variables, emoji.
content object yes Content
html string * Content of html. Format is text/html.
text string * Content of text . Format is text/plain.
preview_text string no Content preview
vars object no Variable. Up to 1MB;When send_mode=0 or send_mode=1, this parameter is valid.
label_id string no Label ID used for this sending
label_name string no Label name used for this sending
headers object no Headers . Up to 1KB.
attachments array[object] no Attachments . The total size shall not exceed 10MB.
content string yes content of attachments. Base64 encoding.
filename string yes The attachment's filename,Example:news.pdf
disposition string yes Value can be attachment or inline.
content_id string yes If the value of disposition is inline and the file type is image, you need to set this value
settings object no Send settings
send_mode int no Sending method. 0 means sending separately; 1 means broadcast sending, and all recipients will be displayed at the same time; The default is 0
return_email_id boolean no Whether to return email ID, default is true .
sandbox boolean no Whether to use sandbox mode, the default is false. If it is true, the mail will not be delivered, and only the request parameters will be verified for validity .
notification boolean no Whether to use the read receipt, the default is false. The default receipt is from, which needs to be used together with the receiving route .
open_tracking boolean no Whether to enable open tracking, the default system setting value. Only when send_mode=0, this parameter is valid.
click_tracking boolean no Whether to enable click tracking, the default system setting . Only when send_mode=0, this parameter is valid.
unsubscribe_tracking boolean no Enable unsubscription or not. Default system setting. Only when send_mode=0, this parameter is valid.
unsubscribe_page_id array[int] no Customized unsubscribe page, default system setting value. Only when send_mode=0, this parameter is valid.
calendar object yes Calendar Settings
time_zone_id string yes Example:Calendar time zone dictionary
start_time string yes Meeting start time. Format : yyyy-MM-dd HH:mm:ss
end_time string yes Meeting end time. Format : yyyy-MM-dd HH:mm:ss
title string yes Meeting title. Maximum 256 characters.
organizer object yes Organizer
name string no Organizer's name .Maximum 64 characters.
email string yes Organizer's email
location string yes Venue. Maximum 128 characters.
description string no Meeting description. Maximum 1024 characters.
participators array[object] no Participators
name string no Participators' name .Maximum 64 characters.
email string yes Participators' email
alarm_min_before integer no Remind the meeting minutes in advance. Range 1~60.
action object no Calendar operation
name string no Operation name. Allowed values: create, update, cancel. The default value is create.
uid string no This parameter needs to be passed when updating and canceling. The uid value will be returned by the interface when creating calendar mail.

Tips:

  1. Html and plain cannot be empty at the same time.

  2. Preview_text can only be used with html. If no html value is transferred, preview_text will not take effect.

  3. Vars is used for variable replacement of mail content. The format is json object, and the format is' {"varname": ["value1," value2 "]} ', where varname is the mail content variable.

    Message content: Dear %name%, welcome to %sp% email service. Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]} Email content replacement: Dear Mike, welcome to engagelab email service.
              Message content: Dear %name%, welcome to %sp% email service.
    
    Corresponding vars value: {"name": ["mike"], "sp": ["engagelab"]}
    
    Email content replacement: Dear Mike, welcome to engagelab email service.
    
            
    このコードブロックは、フローティングウィンドウに表示されます
  4. Users can pass either the 'label_id' or the 'label_name' for this transmission. If the 'label_name' does not exist, the system will automatically create it. If both 'label_id' and 'label_name' are passed, the 'label_name' will be ignored.

  5. Headers is used to customize the header field of the message. The format is json object, and the format is' {"User Define": "123", "User Custom": "abc"} '. However, the key string cannot contain the following values (case insensitive) DKIM-Signature ,Received ,Sender ,Date ,From ,To ,Reply-To ,Cc ,Bcc ,Subject ,Content-Type , Content-Transfer-Encoding ,X-SENDCLOUD-UUID ,X-SENDCLOUD-LOG ,X-Remote-Web-IP ,X-SMTPAPI, Return-Path,X-SENDCLOUD-LOG-NEW

  6. When disposition is set to inline, the attachment content is an image, and the attachment will be rendered and displayed directly in the message body as an inline image. The content_id must be set and a unique string, which is used as the src when the picture is displayed in the message body.

Email content: <html> <img src="cid:image_1000"></img> <img src="cid:image_1001"></img> </html> attachments parameter: [ {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"}, {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"}, ]
              Email content:
    <html>
        <img src="cid:image_1000"></img>
        <img src="cid:image_1001"></img>
    </html>
    
    attachments parameter:
    [
      {"content":" base 64 image content", "filename": "a23456.jpg","disposition": "inline","content_id": "image_1000"},
      {"content":" base 64 image content", "filename": "a23457.jpg","disposition": "inline","content_id": "image_1001"},
    ]

        
このコードブロックは、フローティングウィンドウに表示されます
  1. As customer_args defined by yourself, will be embedded in the header; The subsequent WebHook data will be returned to you.
  2. The request_id is to prevent repeated submission, and the validity period is 1 hour. If it is submitted repeatedly within 1 hour, the last request result will be returned.
  3. The total email size cannot exceed 70MB.

Request Example

curl -X POST 'https://email.api.engagelab.cc/v1/mail/sendcalendar' \ --header 'Authorization: Basic MTIyNF94am06MTJkOGIwODVlNjZhZGUyMmNlNGIwOWI5NjQ2YWQ1ODE=' \ --header 'Content-Type: application/json' \ --data '{ "from": "EngageLab Newsletter <newsletter@mail.engagelab.com>", "to": ["111@qq.com", "222<222@qq.com>"], "body": { "cc": ["noreply@mail.engagelab.com"], "bcc": ["intern<intern@mail.engagelab.com>"], "reply_to": ["reply@mail.engagelab.com"], "subject": "%date% Newsletter ", "content": { "html": "<a href=\"https://www.engagelabe.com\">Newsletter %kkk%</a>", "text": "Newsletter %ttt%", "preview_text": "preview_text is ..." }, "label_id": "1233", "label_name": "", "headers": { "userdefine-tag-location": "us", "userdefine-tag-user": "fashion" }, "settings": { "send_mode": 0, "return_email_id": true, "sandbox": true, "notification": false, "open_tracking": true, "click_tracking": false, "unsubscribe_tracking": true, "unsubscribe_page_id": [1,2] }, "calendar": { "time_zone_id":"America/New_York", "start_time": "2020-12-10 10:00:00", "end_time": "2020-12-10 12:00:00", "title": "meeting titel", "organizer": { "name": "David", "email": "david@mail.engagelab.com" }, "location": "room208", "description": "hello", "alarm_min_before": 5, "participators": [ { "name": "p1", "email": "p1@engagelab.org" }, { "email": "p2@engagelab.org", "name": "p2"}, { "email": "p3@engagelab.org"} ], "action": { "name": "create", "uid": "329r239h239888" } } }, "custom_args": {}, "request_id": "" }'
          curl -X POST 'https://email.api.engagelab.cc/v1/mail/sendcalendar' \
--header 'Authorization: Basic MTIyNF94am06MTJkOGIwODVlNjZhZGUyMmNlNGIwOWI5NjQ2YWQ1ODE=' \
--header 'Content-Type: application/json' \
--data '{
  "from": "EngageLab Newsletter <newsletter@mail.engagelab.com>",       
  "to": ["111@qq.com", "222<222@qq.com>"],    
  "body": {
      "cc": ["noreply@mail.engagelab.com"],       
      "bcc": ["intern<intern@mail.engagelab.com>"],         
      "reply_to": ["reply@mail.engagelab.com"], 
      "subject": "%date% Newsletter ", 
      "content": { 
        "html": "<a href=\"https://www.engagelabe.com\">Newsletter %kkk%</a>", 
        "text": "Newsletter %ttt%",   
        "preview_text": "preview_text is ..." 
      },
      "label_id": "1233",  
      "label_name": "",
      "headers": {                   
        "userdefine-tag-location": "us",  
        "userdefine-tag-user": "fashion"
      },
     
      "settings": {                                                    
        "send_mode": 0,        
        "return_email_id": true,     
        "sandbox": true,        
        "notification": false, 
        "open_tracking": true,                          
        "click_tracking": false,                       
        "unsubscribe_tracking": true,  
        "unsubscribe_page_id": [1,2]
      },
      "calendar": {
        "time_zone_id":"America/New_York",
        "start_time": "2020-12-10 10:00:00",  
        "end_time": "2020-12-10 12:00:00",  
        "title": "meeting titel",                                              
        "organizer": {      
          "name": "David",        
          "email": "david@mail.engagelab.com"                    
        },
        "location": "room208",                                         
        "description": "hello",                                        
        "alarm_min_before": 5,                                         
        "participators": [  
          { 
            "name": "p1",                                                
            "email": "p1@engagelab.org"
          },                      
          { "email": "p2@engagelab.org", "name": "p2"},
          { "email": "p3@engagelab.org"}
        ],
        "action": {                                                      
          "name": "create",   
          "uid": "329r239h239888"                                    
        }
      }
  },
  "custom_args": {},           
  "request_id": "" 
}'

        
このコードブロックは、フローティングウィンドウに表示されます

Response-success

HTTP Status: 200

{ "uid": "20230103T065922Z-uidGen@PC201503200437", "email_ids": [ "1672729159224_15_2942_8497.sc-10_2_226_96-test0$111@qq.com", "1672729159224_15_2942_8497.sc-10_2_226_96-test1$222@qq.com" ], "request_id": "" }
          {
    "uid": "20230103T065922Z-uidGen@PC201503200437",
    "email_ids": [
        "1672729159224_15_2942_8497.sc-10_2_226_96-test0$111@qq.com",
        "1672729159224_15_2942_8497.sc-10_2_226_96-test1$222@qq.com"
    ],
    "request_id": ""
}

        
このコードブロックは、フローティングウィンドウに表示されます

Response-error

HTTP Status :400

{ "code": 30801, "message": "From can not be empty" }
          {
    "code": 30801,
    "message": "From can not be empty"
}

        
このコードブロックは、フローティングウィンドウに表示されます
在文档中心打开