sendWithScheduleWithHttpInfo method

Future<Response> sendWithScheduleWithHttpInfo(
  1. String inboxId,
  2. SendEmailOptions sendEmailOptions, {
  3. DateTime? sendAtTimestamp,
  4. int? sendAtNowPlusSeconds,
  5. bool? validateBeforeEnqueue,
})

Send email with with delay or schedule

Send an email using a delay. Will place the email onto a scheduler that will then be processed and sent. Use delays to schedule email sending.

Note: This method returns the HTTP Response.

Parameters:

  • String inboxId (required): ID of the inbox you want to send the email from

  • SendEmailOptions sendEmailOptions (required):

  • DateTime sendAtTimestamp: Sending timestamp

  • int sendAtNowPlusSeconds: Send after n seconds

  • bool validateBeforeEnqueue: Validate before adding to queue

Implementation

Future<Response> sendWithScheduleWithHttpInfo(String inboxId, SendEmailOptions sendEmailOptions, { DateTime? sendAtTimestamp, int? sendAtNowPlusSeconds, bool? validateBeforeEnqueue, }) async {
  // ignore: prefer_const_declarations
  final path = r'/inboxes/{inboxId}/with-schedule'
    .replaceAll('{inboxId}', inboxId);

  // ignore: prefer_final_locals
  Object? postBody = sendEmailOptions;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (sendAtTimestamp != null) {
    queryParams.addAll(_queryParams('', 'sendAtTimestamp', sendAtTimestamp));
  }
  if (sendAtNowPlusSeconds != null) {
    queryParams.addAll(_queryParams('', 'sendAtNowPlusSeconds', sendAtNowPlusSeconds));
  }
  if (validateBeforeEnqueue != null) {
    queryParams.addAll(_queryParams('', 'validateBeforeEnqueue', validateBeforeEnqueue));
  }

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}