sendEmailSourceOptionalWithHttpInfo method

Future<Response> sendEmailSourceOptionalWithHttpInfo(
  1. SendEmailOptions sendEmailOptions, {
  2. String? inboxId,
  3. bool? useDomainPool,
  4. bool? virtualSend,
})

Send email

Alias for InboxController.sendEmail method - see original method for full details. Sends an email from a given inbox that you have created. If no inbox is supplied a random inbox will be created for you and used to send the email.

Note: This method returns the HTTP Response.

Parameters:

  • SendEmailOptions sendEmailOptions (required):

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

  • bool useDomainPool: Use domain pool. Optionally create inbox to send from using the mailslurp domain pool.

  • bool virtualSend: Optionally create inbox to send from that is a virtual inbox and won't send to external addresses

Implementation

Future<Response> sendEmailSourceOptionalWithHttpInfo(SendEmailOptions sendEmailOptions, { String? inboxId, bool? useDomainPool, bool? virtualSend, }) async {
  // ignore: prefer_const_declarations
  final path = r'/emails';

  // ignore: prefer_final_locals
  Object? postBody = sendEmailOptions;

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

  if (inboxId != null) {
    queryParams.addAll(_queryParams('', 'inboxId', inboxId));
  }
  if (useDomainPool != null) {
    queryParams.addAll(_queryParams('', 'useDomainPool', useDomainPool));
  }
  if (virtualSend != null) {
    queryParams.addAll(_queryParams('', 'virtualSend', virtualSend));
  }

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


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