| Requires any of the roles: | Client, Admin, Partner |
| POST | /communication/sendmail | Sends an email |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Attachment:
content: Optional[str] = None
type: Optional[str] = None
filename: Optional[str] = None
disposition: Optional[str] = None
content_id: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AttachmentStream:
stream: Optional[bytes] = None
name: Optional[str] = None
type: Optional[str] = None
disposition: Optional[str] = None
contentid: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SendMailRequest:
# @ApiMember(Description="Email address of sender. If it is not set the a default address will be used.")
from_address: Optional[str] = None
"""
Email address of sender. If it is not set the a default address will be used.
"""
# @ApiMember(Description="List of recipient email addresses", IsRequired=true)
recipients: Optional[List[str]] = None
"""
List of recipient email addresses
"""
# @ApiMember(Description="Email subject", IsRequired=true)
subject: Optional[str] = None
"""
Email subject
"""
# @ApiMember(Description="Plain text body. Either this or HtmlBody is required")
body: Optional[str] = None
"""
Plain text body. Either this or HtmlBody is required
"""
# @ApiMember(Description="Html body. Either this or Body is required")
html_body: Optional[str] = None
"""
Html body. Either this or Body is required
"""
# @ApiMember(Description="Email attachments")
attachments: Optional[List[str]] = None
"""
Email attachments
"""
# @ApiMember(Description="Email attachments")
attachments_object: Optional[List[Attachment]] = None
"""
Email attachments
"""
# @ApiMember(Description="Attachment streams")
attachment_streams: Optional[List[AttachmentStream]] = None
"""
Attachment streams
"""
# @ApiMember(Description="Template substitutions")
template_substitutions: Optional[Dict[str, str]] = None
"""
Template substitutions
"""
# @ApiMember(Description="Template Id")
template_id: Optional[str] = None
"""
Template Id
"""
# @ApiMember(Description="List of BCC email addresses")
bcc: Optional[List[str]] = None
"""
List of BCC email addresses
"""
# @ApiMember(Description="List of CC email addresses")
cc: Optional[List[str]] = None
"""
List of CC email addresses
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/jsonl
Content-Type: text/jsonl
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/jsonl
Content-Length: length
{}