| Requires any of the roles: | Client, Admin, Partner |
| All Verbs | /sendmail/sendgridtemplate |
|---|
"use strict";
export class EmailAddress {
/** @param {{Name?:string,Email?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Name;
/** @type {string} */
Email;
}
export class Personalization {
/** @param {{Tos?:EmailAddress[],Ccs?:EmailAddress[],Bccs?:EmailAddress[],From?:EmailAddress,Subject?:string,Headers?:{ [index:string]: string; },Substitutions?:{ [index:string]: string; },CustomArgs?:{ [index:string]: string; },SendAt?:number,TemplateData?:Object}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {EmailAddress[]} */
Tos;
/** @type {EmailAddress[]} */
Ccs;
/** @type {EmailAddress[]} */
Bccs;
/** @type {EmailAddress} */
From;
/** @type {string} */
Subject;
/** @type {{ [index:string]: string; }} */
Headers;
/** @type {{ [index:string]: string; }} */
Substitutions;
/** @type {{ [index:string]: string; }} */
CustomArgs;
/** @type {?number} */
SendAt;
/** @type {Object} */
TemplateData;
}
export class SendGridMailTemplateRequest {
/** @param {{From?:EmailAddress,Subject?:string,TemplatesId?:string,APIKey?:string,Personalizations?:Personalization[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {EmailAddress} */
From;
/** @type {string} */
Subject;
/** @type {string} */
TemplatesId;
/** @type {string} */
APIKey;
/** @type {Personalization[]} */
Personalizations;
}
JavaScript SendGridMailTemplateRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sendmail/sendgridtemplate HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SendGridMailTemplateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceInterface">
<APIKey>String</APIKey>
<From xmlns:d2p1="http://schemas.datacontract.org/2004/07/SendGrid.Helpers.Mail">
<d2p1:Email>String</d2p1:Email>
<d2p1:Name>String</d2p1:Name>
</From>
<Personalizations xmlns:d2p1="http://schemas.datacontract.org/2004/07/SendGrid.Helpers.Mail">
<d2p1:Personalization>
<d2p1:Bccs>
<d2p1:EmailAddress>
<d2p1:Email>String</d2p1:Email>
<d2p1:Name>String</d2p1:Name>
</d2p1:EmailAddress>
</d2p1:Bccs>
<d2p1:Ccs>
<d2p1:EmailAddress>
<d2p1:Email>String</d2p1:Email>
<d2p1:Name>String</d2p1:Name>
</d2p1:EmailAddress>
</d2p1:Ccs>
<d2p1:CustomArgs xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:CustomArgs>
<d2p1:From>
<d2p1:Email>String</d2p1:Email>
<d2p1:Name>String</d2p1:Name>
</d2p1:From>
<d2p1:Headers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Headers>
<d2p1:SendAt>0</d2p1:SendAt>
<d2p1:Subject>String</d2p1:Subject>
<d2p1:Substitutions xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringstring>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value>String</d4p1:Value>
</d4p1:KeyValueOfstringstring>
</d2p1:Substitutions>
<d2p1:TemplateData />
<d2p1:Tos>
<d2p1:EmailAddress>
<d2p1:Email>String</d2p1:Email>
<d2p1:Name>String</d2p1:Name>
</d2p1:EmailAddress>
</d2p1:Tos>
</d2p1:Personalization>
</Personalizations>
<Subject>String</Subject>
<TemplatesId>String</TemplatesId>
</SendGridMailTemplateRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />