-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac8458c
commit 887346f
Showing
3 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ A wrapper for SendGrid's API to create composable emails. | |
Add the following code to your dependencies in your **`mix.exs`** file: | ||
|
||
```elixir | ||
{:sendgrid, "~> 0.0.1"} | ||
{:sendgrid, "~> 0.0.2"} | ||
``` | ||
|
||
## Configuration | ||
|
@@ -48,16 +48,21 @@ email = | |
|> Email.put_from("[email protected]") | ||
|> Email.put_to("[email protected]") | ||
|> Email.put_subject("Hello From Elixir") | ||
|> Email.put_html("\<html\>\<body\>\<p>Sent from Elixir!\</p\>\</body\>\</html>\") | ||
|> Email.put_html("<html><body><p>Sent from Elixir!</p></body></html>") | ||
|
||
Mailer.send(email) | ||
``` | ||
|
||
### Using a Predefined Template | ||
|
||
```elixir | ||
alias SendGrid.Email | ||
alias SendGrid.{Mailer, Email} | ||
|
||
Email.build() | ||
email = | ||
Email.build() | ||
|> Email.put_template("the_template_id") | ||
|> Email.add_substitution("-foo-", "bar") | ||
|> Email.put_html("<span>Some Text</span>") | ||
|
||
Mailer.send(email) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ defmodule SendGrid.Email do | |
end | ||
|
||
@doc """ | ||
Deletes a single CC address from the email. | ||
Deletes a single `CC` address from the email. | ||
Email.delete_cc(%Email{cc:["[email protected]"]}, "[email protected]")) | ||
%Email{cc:[]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters