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
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class SendGridMailTemplateRequest
    {
        public EmailAddress From = null;
        public String Subject = null;
        public String TemplatesId = null;
        public String APIKey = null;
        public ArrayList<Personalization> Personalizations = null;
        
        public EmailAddress getFrom() { return From; }
        public SendGridMailTemplateRequest setFrom(EmailAddress value) { this.From = value; return this; }
        public String getSubject() { return Subject; }
        public SendGridMailTemplateRequest setSubject(String value) { this.Subject = value; return this; }
        public String getTemplatesId() { return TemplatesId; }
        public SendGridMailTemplateRequest setTemplatesId(String value) { this.TemplatesId = value; return this; }
        public String getApiKey() { return APIKey; }
        public SendGridMailTemplateRequest setApiKey(String value) { this.APIKey = value; return this; }
        public ArrayList<Personalization> getPersonalizations() { return Personalizations; }
        public SendGridMailTemplateRequest setPersonalizations(ArrayList<Personalization> value) { this.Personalizations = value; return this; }
    }

    public static class EmailAddress
    {
        public String Name = null;
        public String Email = null;
        
        public String getName() { return Name; }
        public EmailAddress setName(String value) { this.Name = value; return this; }
        public String getEmail() { return Email; }
        public EmailAddress setEmail(String value) { this.Email = value; return this; }
    }

    public static class Personalization
    {
        public ArrayList<EmailAddress> Tos = null;
        public ArrayList<EmailAddress> Ccs = null;
        public ArrayList<EmailAddress> Bccs = null;
        public EmailAddress From = null;
        public String Subject = null;
        public HashMap<String,String> Headers = null;
        public HashMap<String,String> Substitutions = null;
        public HashMap<String,String> CustomArgs = null;
        public Long SendAt = null;
        public Object TemplateData = null;
        
        public ArrayList<EmailAddress> getTos() { return Tos; }
        public Personalization setTos(ArrayList<EmailAddress> value) { this.Tos = value; return this; }
        public ArrayList<EmailAddress> getCcs() { return Ccs; }
        public Personalization setCcs(ArrayList<EmailAddress> value) { this.Ccs = value; return this; }
        public ArrayList<EmailAddress> getBccs() { return Bccs; }
        public Personalization setBccs(ArrayList<EmailAddress> value) { this.Bccs = value; return this; }
        public EmailAddress getFrom() { return From; }
        public Personalization setFrom(EmailAddress value) { this.From = value; return this; }
        public String getSubject() { return Subject; }
        public Personalization setSubject(String value) { this.Subject = value; return this; }
        public HashMap<String,String> getHeaders() { return Headers; }
        public Personalization setHeaders(HashMap<String,String> value) { this.Headers = value; return this; }
        public HashMap<String,String> getSubstitutions() { return Substitutions; }
        public Personalization setSubstitutions(HashMap<String,String> value) { this.Substitutions = value; return this; }
        public HashMap<String,String> getCustomArgs() { return CustomArgs; }
        public Personalization setCustomArgs(HashMap<String,String> value) { this.CustomArgs = value; return this; }
        public Long getSendAt() { return SendAt; }
        public Personalization setSendAt(Long value) { this.SendAt = value; return this; }
        public Object getTemplateData() { return TemplateData; }
        public Personalization setTemplateData(Object value) { this.TemplateData = value; return this; }
    }

}

Java SendGridMailTemplateRequest DTOs

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

HTTP + 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/" />