| All Verbs | /sendmail/sendgrid/single |
|---|
import 'package:servicestack/servicestack.dart';
class EmailAddress implements IConvertible
{
String? name;
String? email;
EmailAddress({this.name,this.email});
EmailAddress.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
email = json['email'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'email': email
};
getTypeName() => "EmailAddress";
TypeContext? context = _ctx;
}
class SendGridSingleMailRequest implements IConvertible
{
EmailAddress? to;
String? subject;
String? templateId;
EmailAddress? replyToEmail;
EmailAddress? fromEmail;
String? plaintText;
String? htmlText;
String? apiKey;
SendGridSingleMailRequest({this.to,this.subject,this.templateId,this.replyToEmail,this.fromEmail,this.plaintText,this.htmlText,this.apiKey});
SendGridSingleMailRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
to = JsonConverters.fromJson(json['to'],'EmailAddress',context!);
subject = json['subject'];
templateId = json['templateId'];
replyToEmail = JsonConverters.fromJson(json['replyToEmail'],'EmailAddress',context!);
fromEmail = JsonConverters.fromJson(json['fromEmail'],'EmailAddress',context!);
plaintText = json['plaintText'];
htmlText = json['htmlText'];
apiKey = json['apiKey'];
return this;
}
Map<String, dynamic> toJson() => {
'to': JsonConverters.toJson(to,'EmailAddress',context!),
'subject': subject,
'templateId': templateId,
'replyToEmail': JsonConverters.toJson(replyToEmail,'EmailAddress',context!),
'fromEmail': JsonConverters.toJson(fromEmail,'EmailAddress',context!),
'plaintText': plaintText,
'htmlText': htmlText,
'apiKey': apiKey
};
getTypeName() => "SendGridSingleMailRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'sfgboxapi.dev.scadsoftware.com', types: <String, TypeInfo> {
'EmailAddress': TypeInfo(TypeOf.Class, create:() => EmailAddress()),
'SendGridSingleMailRequest': TypeInfo(TypeOf.Class, create:() => SendGridSingleMailRequest()),
});
Dart SendGridSingleMailRequest DTOs
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 /sendmail/sendgrid/single HTTP/1.1
Host: sfgboxapi.dev.scadsoftware.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"to":{"name":"String","email":"String"},"subject":"String","templateId":"String","replyToEmail":{"name":"String","email":"String"},"fromEmail":{"name":"String","email":"String"},"plaintText":"String","htmlText":"String","apiKey":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{}