| Requires any of the roles: | Client, Admin, Partner |
| All Verbs | /sendmail/sendgridtemplate |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class SendGridMailTemplateRequest
{
open var From:EmailAddress? = null
open var Subject:String? = null
open var TemplatesId:String? = null
open var APIKey:String? = null
open var Personalizations:ArrayList<Personalization>? = null
}
open class EmailAddress
{
open var Name:String? = null
open var Email:String? = null
}
open class Personalization
{
open var Tos:ArrayList<EmailAddress>? = null
open var Ccs:ArrayList<EmailAddress>? = null
open var Bccs:ArrayList<EmailAddress>? = null
open var From:EmailAddress? = null
open var Subject:String? = null
open var Headers:HashMap<String,String>? = null
open var Substitutions:HashMap<String,String>? = null
open var CustomArgs:HashMap<String,String>? = null
open var SendAt:Long? = null
open var TemplateData:Object? = null
}
Kotlin 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/" />