Skip to content

Instantly share code, notes, and snippets.

@stevedomin
Created May 6, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevedomin/96d7d0870abb44822cfc85ec5d6fc47c to your computer and use it in GitHub Desktop.
Save stevedomin/96d7d0870abb44822cfc85ec5d6fc47c to your computer and use it in GitHub Desktop.
plug_attachment
import Swoosh.Email
upload_invoice = %Plug.Upload{
path: "/tmp/plug/DEFfF014AaA01F",
content_type: "",
filename: "invoice-peter-may.pdf"
}
new()
|> to("peter@example.com")
|> from({"Jarvis", "jarvis@example.com"})
|> subject("Invoice May")
|> text_body("Here is the invoice for your superhero services in May.")
|> attachment(uploaded_invoice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment