postMailSend method
Future<RestApiResponse>
postMailSend({
- String uuid = '',
- String oid = '',
- String from = '-',
- List<
String> ? to, - List<
String> ? cc, - List<
String> ? bcc, - String name = '-',
- String description = '-',
- String subject = '-',
- String htmlContent = '-',
- String plainContent = '-',
- String template = '',
- Map<
String, dynamic> ? templateData, - List<
Map< ? attachments,String, dynamic> > - int priorityValue = 3,
- String priorityText = 'normal',
- bool convertImageDataSrcToFileSrc = false,
- bool acknowledgementRequired = false,
- bool keepCalendar = false,
- bool sendAssignReceiver = false,
- DateTime? startTime,
- String action = '',
- String actions = '',
This request allows to update existing email and send it (when body does not contain any OID a new mail is beeing created)
Hinweis zur neuen API:
Aktualisiert eine E-Mail und versendet sie (POST v1/mail/send); ohne OID
im Body wird eine neue Mail erstellt.
Implementation
Future<RestApiResponse> postMailSend({
String uuid = '',
String oid = '',
String from = '-',
List<String>? to,
List<String>? cc,
List<String>? bcc,
String name = '-',
String description = '-',
String subject = '-',
String htmlContent = '-',
String plainContent = '-',
String template = '',
Map<String, dynamic>? templateData,
List<Map<String, dynamic>>? attachments,
int priorityValue = 3,
String priorityText = 'normal',
bool convertImageDataSrcToFileSrc = false,
bool acknowledgementRequired = false,
bool keepCalendar = false,
bool sendAssignReceiver = false,
DateTime? startTime,
String action = '',
String actions = '',
}) {
final Map<String, String> query = <String, String>{};
if (action.isNotEmpty) query['action'] = action;
if (actions.isNotEmpty) query['actions'] = actions;
final Map<String, dynamic> body = <String, dynamic>{
'~UUID': uuid,
'~ObjectID': oid,
'from': from,
};
if (to != null) body['to'] = to;
if (cc != null) body['cc'] = cc;
if (bcc != null) body['bcc'] = bcc;
body['name'] = name;
body['description'] = description;
body['subject'] = subject;
body['htmlContent'] = htmlContent;
body['plainContent'] = plainContent;
if (template != '') body['template'] = template;
if (templateData != null) body['templateData'] = templateData;
if (attachments != null) body['attachments'] = attachments;
body['acknowledgementRequired'] = acknowledgementRequired;
body['convertImageDataSrcToFileSrc'] = convertImageDataSrcToFileSrc;
body['keepCalendar'] = keepCalendar;
body['sendAssignReceiver'] = sendAssignReceiver;
if (startTime != null) body['startTime'] = startTime.toISOFormatString();
body['priority'] = _priority(priorityValue, priorityText);
return _execute(
method: ApiHttpMethod.post,
path: '/mail/send',
queryParameters: query,
body: jsonEncode(body),
operation: 'postMailSend',
);
}