| Requires any of the roles: | Client, Admin, Partner |
| POST | /communication/sendmail | Sends an email |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using digitaluapi.ServiceModel;
namespace digitaluapi.ServiceModel
{
public partial class Attachment
{
public virtual string Content { get; set; }
public virtual string Type { get; set; }
public virtual string Filename { get; set; }
public virtual string Disposition { get; set; }
public virtual string ContentId { get; set; }
}
public partial class AttachmentStream
{
public virtual Stream Stream { get; set; }
public virtual string Name { get; set; }
public virtual string Type { get; set; }
public virtual string Disposition { get; set; }
public virtual string Contentid { get; set; }
}
public partial class SendMailRequest
{
///<summary>
///Email address of sender. If it is not set the a default address will be used.
///</summary>
[ApiMember(Description="Email address of sender. If it is not set the a default address will be used.")]
public virtual string FromAddress { get; set; }
///<summary>
///List of recipient email addresses
///</summary>
[ApiMember(Description="List of recipient email addresses", IsRequired=true)]
public virtual IEnumerable<string> Recipients { get; set; }
///<summary>
///Email subject
///</summary>
[ApiMember(Description="Email subject", IsRequired=true)]
public virtual string Subject { get; set; }
///<summary>
///Plain text body. Either this or HtmlBody is required
///</summary>
[ApiMember(Description="Plain text body. Either this or HtmlBody is required")]
public virtual string Body { get; set; }
///<summary>
///Html body. Either this or Body is required
///</summary>
[ApiMember(Description="Html body. Either this or Body is required")]
public virtual string HtmlBody { get; set; }
///<summary>
///Email attachments
///</summary>
[ApiMember(Description="Email attachments")]
public virtual string[] Attachments { get; set; }
///<summary>
///Email attachments
///</summary>
[ApiMember(Description="Email attachments")]
public virtual Attachment[] AttachmentsObject { get; set; }
///<summary>
///Attachment streams
///</summary>
[ApiMember(Description="Attachment streams")]
public virtual AttachmentStream[] AttachmentStreams { get; set; }
///<summary>
///Template substitutions
///</summary>
[ApiMember(Description="Template substitutions")]
public virtual Dictionary<string, string> TemplateSubstitutions { get; set; }
///<summary>
///Template Id
///</summary>
[ApiMember(Description="Template Id")]
public virtual string TemplateId { get; set; }
///<summary>
///List of BCC email addresses
///</summary>
[ApiMember(Description="List of BCC email addresses")]
public virtual IEnumerable<string> Bcc { get; set; }
///<summary>
///List of CC email addresses
///</summary>
[ApiMember(Description="List of CC email addresses")]
public virtual IEnumerable<string> Cc { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /communication/sendmail HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
FromAddress: String,
Subject: String,
Body: String,
HtmlBody: String,
Attachments:
[
String
],
AttachmentsObject:
[
{
Content: String,
Type: String,
Filename: String,
Disposition: String,
ContentId: String
}
],
AttachmentStreams:
[
{
Name: String,
Type: String,
Disposition: String,
Contentid: String
}
],
TemplateSubstitutions:
{
String: String
},
TemplateId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
}