woohaaha
How to use Phoenix Layout and Views when sending transactional emails using ex_aws and ex_aws_ses?
Hey all,
I’m using ex_aws and ex_aws_ses to send email via the aws api (not smtp). I’m doing it like so:
ExAws.SES.send_email(destination, message, "from-me@example.com", [])
|> ExAws.request()
|> case do
...
The message is basically a map:
%{text: "hello world", html: "<h1>hello world</h1>", subject: "Open me"}
I’d like to use the Phoenix templates/views so that I can write the emails in templates, perhaps templates like welcome_email.html.eex and welcome_email.text.eex. I’ve done a fair bit of searching but and haven’t come across the simple solution. Perhaps I’m not searching for the right terms?
What’s the library or X lines of code that can help me generate those text and html strings that I can send to SES while still having them be in a template and therefore easier to visually parse/edit?
Thank you
Most Liked
wmnnd
You could give Swoosh and phoenix_swoosh a try:
https://github.com/swoosh/swoosh
https://github.com/swoosh/phoenix_swoosh
Swoosh also takes care of sending emails via SES, so you don’t have to use ExAws directly.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









