Class MailtrapClientOptions
- Namespace
- Mailtrap.Configuration
- Assembly
- Mailtrap.dll
A set of parameters to configure Mailtrap API client.
public record MailtrapClientOptions : IEquatable<MailtrapClientOptions>
- Inheritance
-
MailtrapClientOptions
- Implements
Constructors
MailtrapClientOptions()
Parameterless instance constructor.
public MailtrapClientOptions()
MailtrapClientOptions(string)
Primary instance constructor, which allows to set an authentication token.
public MailtrapClientOptions(string apiToken)
Parameters
apiToken
stringAPI authentication token.
Required. Must be non-empty string.
Exceptions
Properties
ApiToken
Gets or sets API authentication token.
Required. Must be non-empty string.
public string ApiToken { get; set; }
Property Value
- string
Contains API authentication token.
Default
Gets default configuration.
public static MailtrapClientOptions Default { get; }
Property Value
- MailtrapClientOptions
Contains default configuration.
Includes default values for send API, serialization and empty authentication settings.
Remarks
Returns new object every time, thus it's safe to mutate returned value.
InboxId
Gets or sets Inbox ID to route test emails to.
When set to non-default value, all emails will be sent as test and routed to this inbox.
public long? InboxId { get; set; }
Property Value
PrettyJson
Gets of sets flag which controls JSON indentation for pretty or minified output.
public bool PrettyJson { get; set; }
Property Value
UseBulkApi
Gets or sets flag which controls usage of Bulk API for outgoing emails.
public bool UseBulkApi { get; set; }
Property Value
- bool
When false emails will be sent as transactional.
When true emails will be sent as bulk.Default is false.
Methods
Init(MailtrapClientOptions)
Initializes current MailtrapClientOptions instance with values from source
.
public void Init(MailtrapClientOptions source)
Parameters
source
MailtrapClientOptionsSource MailtrapClientOptions instance to copy values from.
Remarks
Performs a shallow copy.