zeptomail

Types

pub type Addressee {
  Addressee(name: String, address: String)
}

Constructors

  • Addressee(name: String, address: String)
pub type ApiData {
  ApiData(
    object: String,
    request_id: String,
    message: String,
    data: List(ApiDatum),
  )
}

Constructors

  • ApiData(
      object: String,
      request_id: String,
      message: String,
      data: List(ApiDatum),
    )
pub type ApiDatum {
  ApiDatum(code: String, message: String)
}

Constructors

  • ApiDatum(code: String, message: String)

An error returned by the ZeptoMail API. The possible error codes are documented here: https://www.zoho.com/zeptomail/help/api/error-codes.html

pub type ApiError {
  ApiError(
    code: String,
    message: String,
    details: List(ApiErrorDetail),
  )
  UnexpectedResponse(json.DecodeError)
}

Constructors

  • ApiError(
      code: String,
      message: String,
      details: List(ApiErrorDetail),
    )
  • UnexpectedResponse(json.DecodeError)
pub type ApiErrorDetail {
  ApiErrorDetail(
    code: String,
    message: String,
    target: Option(String),
    target_value: Option(String),
  )
}

Constructors

  • ApiErrorDetail(
      code: String,
      message: String,
      target: Option(String),
      target_value: Option(String),
    )
pub type Body {
  TextBody(content: String)
  HtmlBody(content: String)
}

Constructors

  • TextBody(content: String)
  • HtmlBody(content: String)
pub type Email {
  Email(
    from: Addressee,
    to: List(Addressee),
    cc: List(Addressee),
    bcc: List(Addressee),
    reply_to: List(Addressee),
    body: Body,
    subject: String,
  )
}

Constructors

  • Email(
      from: Addressee,
      to: List(Addressee),
      cc: List(Addressee),
      bcc: List(Addressee),
      reply_to: List(Addressee),
      body: Body,
      subject: String,
    )

Functions

pub fn decode_email_response(
  response: Response(String),
) -> Result(ApiData, ApiError)

Create a HTTP request to send an email via the ZeptoMail API

pub fn email_request(
  email: Email,
  api_token: String,
) -> Request(String)

Create a HTTP request to send an email via the ZeptoMail API

Search Document