gleesend/emails

Types

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

Constructors

pub type SendEmailError {
  BadRequestError
  ParseResponseBodyError
}

Constructors

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

Constructors

  • SuccessResponse(id: String)

Values

pub fn create_email(
  client client: gleesend.Resend,
  from from: String,
  to to: List(String),
  subject subject: String,
) -> ResendEmail
pub fn to_request(email: ResendEmail) -> request.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