getEmailWithHttpInfo method

Future<Response> getEmailWithHttpInfo(
  1. String emailId, {
  2. bool? decode,
})

Get email content including headers and body. Expects email to exist by ID. For emails that may not have arrived yet use the WaitForController.

Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawEmail endpoints

Note: This method returns the HTTP Response.

Parameters:

  • String emailId (required):

  • bool decode: Decode email body quoted-printable encoding to plain text. SMTP servers often encode text using quoted-printable format (for instance =D7). This can be a pain for testing

Implementation

Future<Response> getEmailWithHttpInfo(String emailId, { bool? decode, }) async {
  // ignore: prefer_const_declarations
  final path = r'/emails/{emailId}'
    .replaceAll('{emailId}', emailId);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (decode != null) {
    queryParams.addAll(_queryParams('', 'decode', decode));
  }

  const contentTypes = <String>[];


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