Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sticksnleaves/bamboo_eex
EEx template support for Bamboo
https://github.com/sticksnleaves/bamboo_eex
bamboo eex elixir email
Last synced: about 1 month ago
JSON representation
EEx template support for Bamboo
- Host: GitHub
- URL: https://github.com/sticksnleaves/bamboo_eex
- Owner: sticksnleaves
- License: mit
- Created: 2017-10-03T20:08:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T16:49:36.000Z (over 6 years ago)
- Last Synced: 2024-10-29T08:40:41.081Z (about 2 months ago)
- Topics: bamboo, eex, elixir, email
- Language: Elixir
- Size: 12.7 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bamboo.EEx
[![Build Status](https://travis-ci.org/sticksnleaves/bamboo_eex.svg?branch=master)](https://travis-ci.org/sticksnleaves/bamboo_eex)
No Phoenix? No problem!
Use `Bamboo.EEx` to add EEx template support to Bamboo.
## Installation
```elixir
def deps do
[
{:bamboo_eex, "~> 0.1.0"}
]
end
```## Examples
```elixir
defmodule MyApp.Email do
use Bamboo.EEx, path: "lib/my_app/views"def text_and_html_email() do
new_email()
|> render_to_html("email.html.eex")
|> render_to_text("email.text.eex")
enddef email_with_assigns(user) do
new_email()
|> render_to_html("email.html.eex", user: user)
enddef email_with_already_assigned_user(user) do
new_email()
|> assign(:user, user)
|> render_to_html("email.html.eex")
end
end
```## Options
When declaring `use Bamboo.EEx` you can pass in any option that EEx supports.
Consult the [EEx documentation](https://hexdocs.pm/eex/EEx.html#module-options)
for additional details on available options.### Additional Options
`:path` - the root directory used to find EEx templates