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
apiTokenstringAPI 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 Sandbox ID to route emails to.
When set to non-default value, all emails will be sent to this sandbox.
[Obsolete("InboxId is deprecated and will be removed in a future major release; use SandboxId instead.")]
public long? InboxId { get; set; }
Property Value
Remarks
Deprecated, use SandboxId instead. Reads and writes the same value.
Declared before SandboxId, so that configuration binding sets SandboxId last: when a configuration section has both keys, SandboxId wins.
PrettyJson
Gets of sets flag which controls JSON indentation for pretty or minified output.
public bool PrettyJson { get; set; }
Property Value
SandboxId
Gets or sets Sandbox ID to route emails to.
When set to non-default value, all emails will be sent to this sandbox.
public long? SandboxId { 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
sourceMailtrapClientOptionsSource MailtrapClientOptions instance to copy values from.
Remarks
Performs a shallow copy.