Paubox.Attachment (paubox v1.1.0)

Copy Markdown View Source

Summary

Types

t()

A Paubox email attachment. Additional info can be found at https://docs.paubox.com/docs/paubox_email_api/messages

Functions

This will create a new Paubox.Attachment struct from a file. It will read the file in, encode it to base64, and set the content type based on the file extension. If no content type is found, it will default to text/plain.

This will write the attachment to the specified directory. If no directory is specified, it will default to the current directory.

Types

t()

@type t() :: %Paubox.Attachment{
  content: String.t(),
  content_type: String.t(),
  file_name: String.t()
}

A Paubox email attachment. Additional info can be found at https://docs.paubox.com/docs/paubox_email_api/messages

Functions

new(file_path)

This will create a new Paubox.Attachment struct from a file. It will read the file in, encode it to base64, and set the content type based on the file extension. If no content type is found, it will default to text/plain.

output(attachment, outdir \\ ".")

This will write the attachment to the specified directory. If no directory is specified, it will default to the current directory.