Mailtrap.Email.Mailbox (mailtrap v0.1.1)

Mailbox struct

Why mailbox? https://www.rfc-editor.org/rfc/rfc5322#section-3.4

Link to this section Summary

Functions

Builds Mailbox struct

Link to this section Types

@type t() :: %Mailtrap.Email.Mailbox{
  email: nil | String.t() | any(),
  name: nil | String.t() | nil
}

Link to this section Functions

Link to this function

build(name, address)

@spec build(String.t() | nil, String.t()) :: t()

Builds Mailbox struct

examples

Examples

iex> Mailtrap.Email.Mailbox.build(nil, "jane.doe@example.com") %Mailtrap.Email.Mailbox{email: "jane.doe@example.com"}

iex> Mailtrap.Email.Mailbox.build("", "jane.doe@example.com") %Mailtrap.Email.Mailbox{email: "jane.doe@example.com"}

iex> Mailtrap.Email.Mailbox.build("Jane", "jane.doe@example.com") %Mailtrap.Email.Mailbox{email: "jane.doe@example.com", name: "Jane"}