Mailman.Attachment (Mailman v0.4.3) View Source

A struct defining an attachable file. It automatically detect the mime type based on file extension.

Link to this section Summary

Functions

Get the attachment struct with disposition 'attachment'.

Get the attachment struct with disposition 'attachment'. Throw an error if anything goes wrong.

Get the attachment struct with disposition 'inline'.

Get the attachment struct with disposition 'inline'. Throw an error if anything goes wrong.

Link to this section Types

Specs

t() :: %Mailman.Attachment{
  data: String.t(),
  disposition: String.t(),
  file_name: String.t(),
  mime_sub_type: term(),
  mime_type: String.t()
}

Link to this section Functions

Link to this function

attach(url_or_file_path, file_name \\ nil, mime_tuple \\ nil)

View Source

Get the attachment struct with disposition 'attachment'.

Link to this function

attach!(url_or_file_path, file_name \\ nil, mime_tuple \\ nil)

View Source

Get the attachment struct with disposition 'attachment'. Throw an error if anything goes wrong.

Link to this function

create(url_or_file_path, disposition, file_name \\ nil, mime_tuple \\ nil)

View Source
Link to this function

inline(url_or_file_path, file_name \\ nil, mime_tuple \\ nil)

View Source

Specs

inline(String.t(), String.t(), {String.t(), String.t()}) ::
  {:ok, t()} | {:error, String.t()}
inline(String.t(), String.t(), {String.t(), String.t()}) :: t()

Get the attachment struct with disposition 'inline'.

Link to this function

inline!(url_or_file_path, file_name \\ nil, mime_tuple \\ nil)

View Source

Get the attachment struct with disposition 'inline'. Throw an error if anything goes wrong.

Link to this function

mime_type_and_subtype_from_extension(path)

View Source