Swoosh v0.10.0 Swoosh.Attachment View Source
Struct representing an attachment in an email.
Link to this section Summary
Functions
Creates a new Attachment
Link to this section Types
Link to this type
t()
View Source
t() :: %Swoosh.Attachment{content_type: term, filename: term, path: term}
Link to this section Functions
Link to this function
new(path, opts \\ [])
View Source
new(binary, Keyword.t) :: %Swoosh.Attachment{content_type: term, filename: term, path: term}
Creates a new Attachment
Examples:
Attachment.new("/path/to/attachment.png")
Attachment.new("/path/to/attachment.png", filename: "image.png")
Attachment.new("/path/to/attachment.png", filename: "image.png", content_type: "image/png")
Attachment.new(params["file"]) # Where params["file"] is a %Plug.Upload