Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /settings/test-email |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class EmailAccount implements IConvertible
{
String? id;
String? server;
String? userName;
int? port;
String? emailAddress;
String? displayName;
String? password;
EmailAccount({this.id,this.server,this.userName,this.port,this.emailAddress,this.displayName,this.password});
EmailAccount.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
server = json['server'];
userName = json['userName'];
port = json['port'];
emailAddress = json['emailAddress'];
displayName = json['displayName'];
password = json['password'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'server': server,
'userName': userName,
'port': port,
'emailAddress': emailAddress,
'displayName': displayName,
'password': password
};
getTypeName() => "EmailAccount";
TypeContext? context = _ctx;
}
/**
* Send a test email from the specified account
*/
// @Api(Description="Send a test email from the specified account")
class SendTestEmail implements IPost, IConvertible
{
/**
* The email account to send from
*/
// @ApiMember(Description="The email account to send from")
EmailAccount? account;
/**
* The user to send to
*/
// @ApiMember(Description="The user to send to")
String? emailAddress;
SendTestEmail({this.account,this.emailAddress});
SendTestEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
account = JsonConverters.fromJson(json['account'],'EmailAccount',context!);
emailAddress = json['emailAddress'];
return this;
}
Map<String, dynamic> toJson() => {
'account': JsonConverters.toJson(account,'EmailAccount',context!),
'emailAddress': emailAddress
};
getTypeName() => "SendTestEmail";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'EmailAccount': TypeInfo(TypeOf.Class, create:() => EmailAccount()),
'SendTestEmail': TypeInfo(TypeOf.Class, create:() => SendTestEmail()),
});
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 /settings/test-email HTTP/1.1
Host: team.evovoice.io
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"account":{"id":"String","server":"String","userName":"String","port":0,"emailAddress":"String","displayName":"String","password":"String"},"emailAddress":"String"}