| GET,POST,DELETE | /{Workspace}/DocumentTemplate/{Type}/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
class EmailOutputEngine(str, Enum):
DEFAULT_HTML = 'DefaultHtml'
DEFAULT_PDF = 'DefaultPdf'
CUSTOM = 'Custom'
STANDARD = 'Standard'
class EmailOutputFormat(str, Enum):
EMBED = 'Embed'
ATTACH_PDF = 'AttachPdf'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DocumentEmailTemplate:
"""
Represents the email output configuration for a single document template.
"""
type: Optional[str] = None
workspace: Optional[str] = None
engine: Optional[EmailOutputEngine] = None
format: Optional[EmailOutputFormat] = None
pdf_template: Optional[str] = None
body_template: Optional[str] = None
subject_template: Optional[str] = None
header_template: Optional[str] = None
footer_template: Optional[str] = None
page_size: Optional[str] = None
orientation: Optional[str] = None
margins: Optional[str] = None
Python DocumentEmailTemplate DTOs
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 /{Workspace}/DocumentTemplate/{Type}/Email HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Type: String,
Workspace: String,
Engine: DefaultHtml,
Format: Embed,
PdfTemplate: String,
BodyTemplate: String,
SubjectTemplate: String,
HeaderTemplate: String,
FooterTemplate: String,
PageSize: String,
Orientation: String,
Margins: String
}