sfgboxapi

<back to all web services

SendGridSingleMailRequest

Requires Authentication
The following routes are available for this service:
All Verbs/sendmail/sendgrid/single
"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 SendGridSingleMailRequest {
    /** @param {{to?:EmailAddress,subject?:string,templateId?:string,replyToEmail?:EmailAddress,fromEmail?:EmailAddress,plaintText?:string,htmlText?:string,apiKey?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {EmailAddress} */
    to;
    /** @type {string} */
    subject;
    /** @type {string} */
    templateId;
    /** @type {EmailAddress} */
    replyToEmail;
    /** @type {EmailAddress} */
    fromEmail;
    /** @type {string} */
    plaintText;
    /** @type {string} */
    htmlText;
    /** @type {string} */
    apiKey;
}

JavaScript SendGridSingleMailRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /sendmail/sendgrid/single HTTP/1.1 
Host: sfgboxapi.dev.scadsoftware.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"to":{"name":"String","email":"String"},"subject":"String","templateId":"String","replyToEmail":{"name":"String","email":"String"},"fromEmail":{"name":"String","email":"String"},"plaintText":"String","htmlText":"String","apiKey":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}