patchMail method
Future<RestApiResponse>
patchMail({
- 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 = '-',
- Map<
String, dynamic> ? templateData, - List<
Map< ? attachments,String, dynamic> > - int priorityValue = 3,
- String priorityText = 'normal',
- bool acknowledgementRequired = false,
- bool keepCalendar = false,
- bool convertImageDataSrcToFileSrc = false,
- DateTime? startTime,
- String actions = '',
This request allows to update existing an email, either the uuid or oid are needed
Hinweis zur neuen API:
Aktualisiert eine bestehende E-Mail (PATCH v1/mail); benötigt uuid oder
oid.
Implementation
Future<RestApiResponse> patchMail({
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 = '-',
Map<String, dynamic>? templateData,
List<Map<String, dynamic>>? attachments,
int priorityValue = 3,
String priorityText = 'normal',
bool acknowledgementRequired = false,
bool keepCalendar = false,
bool convertImageDataSrcToFileSrc = false,
DateTime? startTime,
String actions = '',
}) {
final Map<String, String> query = <String, String>{};
if (actions.isNotEmpty) query['actions'] = actions;
final Map<String, dynamic> body = <String, dynamic>{};
if (uuid.isNotEmpty) body['~UUID'] = uuid;
if (oid.isNotEmpty) body['~ObjectID'] = oid;
body['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 (templateData != null) body['templateData'] = templateData;
if (attachments != null) body['attachments'] = attachments;
body['acknowledgementRequired'] = acknowledgementRequired;
body['convertImageDataSrcToFileSrc'] = convertImageDataSrcToFileSrc;
body['keepCalendar'] = keepCalendar;
if (startTime != null) body['startTime'] = startTime.toISOFormatString();
body['priority'] = _priority(priorityValue, priorityText);
return _execute(
method: ApiHttpMethod.patch,
path: '/mail',
queryParameters: query,
body: jsonEncode(body),
operation: 'patchMail',
);
}