gleesend/emails

Types

pub type ResendEmail {
  ResendEmail(
    client: Resend,
    from: String,
    to: List(String),
    subject: String,
    bcc: Option(List(String)),
    cc: Option(List(String)),
    reply_to: Option(List(String)),
    html: Option(String),
    text: Option(String),
  )
}

Constructors

  • ResendEmail(
      client: Resend,
      from: String,
      to: List(String),
      subject: String,
      bcc: Option(List(String)),
      cc: Option(List(String)),
      reply_to: Option(List(String)),
      html: Option(String),
      text: Option(String),
    )
pub type SendEmailError {
  BadRequestError
  ParseResponseBodyError
}

Constructors

  • BadRequestError
  • ParseResponseBodyError
pub type SuccessResponse {
  SuccessResponse(id: String)
}

Constructors

  • SuccessResponse(id: String)

Functions

pub fn create_email(
  client client: Resend,
  from from: String,
  to to: List(String),
  subject subject: String,
) -> ResendEmail
pub fn to_request(email: ResendEmail) -> Request(String)
pub fn to_response(
  body: String,
  status: Int,
) -> Result(SuccessResponse, SendEmailError)

Takes in the string body of the response and the status returned by your http library of choice

pub fn with_bcc(
  resend: ResendEmail,
  bcc: List(String),
) -> ResendEmail
pub fn with_cc(
  resend: ResendEmail,
  cc: List(String),
) -> ResendEmail
pub fn with_html(
  resend: ResendEmail,
  html: String,
) -> ResendEmail
pub fn with_reply_to(
  resend: ResendEmail,
  reply_to: List(String),
) -> ResendEmail
pub fn with_text(
  resend: ResendEmail,
  text: String,
) -> ResendEmail
Search Document