Skip to main content

SendRawEmailAsync

1. Facts

info

Send an email without attachments, within template.

Method URL

<base url>/send-templated-email

Preferred HTTP method: POST

Authorization: Basic <Your secret string>
ApplicationName: <Your application name>

Body (JSON)

{
"senderAddress": "AMES ENGLISH<mailer@ames.edu.vn>",
"receiverAddress": "tungnt@ames.edu.vn",
"ccAddress": "ngothanhtung.it@gmail.com",
"bccAddress": "tung.ngo@outlook.com",
"templateName": "AMESENGLISH-Dau-Truong-Tieng-Anh-Template",
"templateData": {
"name": "ngo Thanh Tung",
"score": 989
}
}

Response

{
"ok": true
}

2. Example (C#)

var client = new RestClient("https://softech.cloud/api/v1/aws/ses/send-templated-email");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic <Your secret string>");
request.AddHeader("ApplicationName", "EBM");

var body = new {
senderAddress = "AMES ENGLISH<mailer@ames.edu.vn>",
receiverAddress = "tungnt@ames.edu.vn, tungnt@softech.vn",
subject = "Send SES from POSTMAIN within API",
textBody= "This email was sent through Amazon SES",
htmlBody = "<h1>This email was sent through Amazon SES</h1>"
};

request.AddJsonBody(body);
IRestResponse response = client.Execute(request);