| GET,POST,DELETE | /{Workspace}/DocumentTemplate/{Type}/Email |
|---|
import 'package:servicestack/servicestack.dart';
enum EmailOutputEngine
{
DefaultHtml,
DefaultPdf,
Custom,
Standard,
}
enum EmailOutputFormat
{
Embed,
AttachPdf,
}
/**
* Represents the email output configuration for a single document template.
*/
class DocumentEmailTemplate implements IConvertible
{
String? Type;
String? Workspace;
EmailOutputEngine? Engine;
EmailOutputFormat? Format;
String? PdfTemplate;
String? BodyTemplate;
String? SubjectTemplate;
String? HeaderTemplate;
String? FooterTemplate;
String? PageSize;
String? Orientation;
String? Margins;
DocumentEmailTemplate({this.Type,this.Workspace,this.Engine,this.Format,this.PdfTemplate,this.BodyTemplate,this.SubjectTemplate,this.HeaderTemplate,this.FooterTemplate,this.PageSize,this.Orientation,this.Margins});
DocumentEmailTemplate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Type = json['Type'];
Workspace = json['Workspace'];
Engine = JsonConverters.fromJson(json['Engine'],'EmailOutputEngine',context!);
Format = JsonConverters.fromJson(json['Format'],'EmailOutputFormat',context!);
PdfTemplate = json['PdfTemplate'];
BodyTemplate = json['BodyTemplate'];
SubjectTemplate = json['SubjectTemplate'];
HeaderTemplate = json['HeaderTemplate'];
FooterTemplate = json['FooterTemplate'];
PageSize = json['PageSize'];
Orientation = json['Orientation'];
Margins = json['Margins'];
return this;
}
Map<String, dynamic> toJson() => {
'Type': Type,
'Workspace': Workspace,
'Engine': JsonConverters.toJson(Engine,'EmailOutputEngine',context!),
'Format': JsonConverters.toJson(Format,'EmailOutputFormat',context!),
'PdfTemplate': PdfTemplate,
'BodyTemplate': BodyTemplate,
'SubjectTemplate': SubjectTemplate,
'HeaderTemplate': HeaderTemplate,
'FooterTemplate': FooterTemplate,
'PageSize': PageSize,
'Orientation': Orientation,
'Margins': Margins
};
getTypeName() => "DocumentEmailTemplate";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'EmailOutputEngine': TypeInfo(TypeOf.Enum, enumValues:EmailOutputEngine.values),
'EmailOutputFormat': TypeInfo(TypeOf.Enum, enumValues:EmailOutputFormat.values),
'DocumentEmailTemplate': TypeInfo(TypeOf.Class, create:() => DocumentEmailTemplate()),
});
Dart 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
}