digitaluapi

<back to all web services

SendGridMailTemplateRequest

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	From: 
	{
		Name: String,
		Email: String
	},
	Subject: String,
	TemplatesId: String,
	APIKey: String,
	Personalizations: 
	[
		{
			Tos: 
			[
				{
					Name: String,
					Email: String
				}
			],
			Ccs: 
			[
				{
					Name: String,
					Email: String
				}
			],
			Bccs: 
			[
				{
					Name: String,
					Email: String
				}
			],
			From: 
			{
				Name: String,
				Email: String
			},
			Subject: String,
			Headers: 
			{
				String: String
			},
			Substitutions: 
			{
				String: String
			},
			CustomArgs: 
			{
				String: String
			},
			SendAt: 0,
			TemplateData: {}
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	
}