Table of Contents

Class SendEmailResponse

Namespace
Mailtrap.Emails.Responses
Assembly
Mailtrap.Abstractions.dll

Represents send email response object.

public sealed record SendEmailResponse : IEquatable<SendEmailResponse>
Inheritance
SendEmailResponse
Implements

Constructors

SendEmailResponse(bool, IList<string>?, IList<string>?)

Default instance constructor.

public SendEmailResponse(bool success, IList<string>? messageIds = null, IList<string>? errorData = null)

Parameters

success bool

Flag, indicating whether request succeeded or failed and response contains error(s).

messageIds IList<string>

A collection of message IDs.

errorData IList<string>

Errors to associate with the response.

Properties

Empty

Gets an empty response object.

public static SendEmailResponse Empty { get; }

Property Value

SendEmailResponse

Empty response object.

ErrorData

Gets errors, associated with the response.

[JsonPropertyName("errors")]
[JsonPropertyOrder(2)]
public IList<string> ErrorData { get; }

Property Value

IList<string>

Collection of error(s) details.

MessageIds

Gets a collection of IDs of emails that have been sent.

[JsonPropertyName("message_ids")]
[JsonPropertyOrder(3)]
public IList<string> MessageIds { get; }

Property Value

IList<string>

A collection of IDs of emails that have been sent.

Success

Gets a flag, indicating whether request succeeded or failed and response contains error(s).

[JsonPropertyName("success")]
[JsonPropertyOrder(1)]
public bool Success { get; }

Property Value

bool

false when request failed and response contains error(s).
true when request succeeded.