-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send mail to facilitators when they are invited to manage an event
- Loading branch information
Showing
10 changed files
with
624 additions
and
409 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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defmodule Claper.Accounts.LeaderNotifier do | ||
alias Claper.Mailer | ||
|
||
def deliver_event_invitation(event_name, email, url) do | ||
e = ClaperWeb.Notifiers.LeaderNotifier.event_invitation(event_name, email, url) | ||
|
||
with {:ok, _metadata} <- Mailer.deliver(e) do | ||
{:ok, email} | ||
end | ||
end | ||
|
||
end |
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
defmodule ClaperWeb.Notifiers.LeaderNotifier do | ||
use Phoenix.Swoosh, view: ClaperWeb.LeaderNotifierView, layout: {ClaperWeb.LayoutView, :email} | ||
import ClaperWeb.Gettext | ||
|
||
def event_invitation(event_name, email, url) do | ||
new() | ||
|> to(email) | ||
|> from( | ||
{Application.get_env(:claper, :mail) |> Keyword.get(:from_name), | ||
Application.get_env(:claper, :mail) |> Keyword.get(:from)} | ||
) | ||
|> subject(gettext("You have been invited to manage an event")) | ||
|> render_body("invitation.html", %{event_name: event_name, leader_email: email, url: url}) | ||
end | ||
end |
57 changes: 57 additions & 0 deletions
57
lib/claper_web/templates/leader_notifier/invitation.html.heex
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<tr> | ||
<td> | ||
<table | ||
width="95%" | ||
border="0" | ||
align="center" | ||
cellpadding="0" | ||
cellspacing="0" | ||
style="max-width:670px;background:#fff; border-radius:3px; text-align:center;-webkit-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);-moz-box-shadow:0 6px 18px 0 rgba(0,0,0,.06);box-shadow:0 6px 18px 0 rgba(0,0,0,.06);" | ||
> | ||
<tr> | ||
<td style="height:40px;"> </td> | ||
</tr> | ||
<tr> | ||
<td style="padding:0 35px;"> | ||
<h1 style="color:#1e1e2d; font-weight:500; margin:0;font-size:32px;font-family:'Rubik',sans-serif;"> | ||
<%= gettext("You have been invited") %> | ||
</h1> | ||
<span style="display:inline-block; vertical-align:middle; margin:29px 0 26px; border-bottom:1px solid #cecece; width:100px;"> | ||
</span> | ||
<p style="color:#455056; font-size:15px;line-height:24px; margin:0;"> | ||
<%= gettext("Someone invited you to manage the event: %{name}", name: @event_name) %> | ||
</p> | ||
<p style="color:#455056; font-size:15px;line-height:24px; margin:0;"> | ||
<%= gettext("To accept the invitation, please login or create an account with this email: %{email}", email: @leader_email) %> | ||
</p> | ||
<a | ||
href={@url} | ||
target="_blank" | ||
style="background:#8611ed;text-decoration:none !important; font-weight:500; margin-top:35px; color:#fff;text-transform:uppercase; font-size:14px;padding:10px 24px;display:inline-block;border-radius:50px;" | ||
> | ||
<%= gettext("Login or create account") %> | ||
</a> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="height:20px;"> </td> | ||
</tr> | ||
<tr> | ||
<td style="font-size: 0.8em; color: #6C6C6C"> | ||
<p class="sub"> | ||
<%= gettext( | ||
"If you’re having trouble with the button above, copy and paste the URL below into your web browser" | ||
) %>. | ||
</p> | ||
<p class="sub"><%= @url %></p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="height:40px;"> </td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td style="height:20px;"> </td> | ||
</tr> |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
defmodule ClaperWeb.LeaderNotifierView do | ||
use Phoenix.View, root: "lib/claper_web/templates" | ||
import ClaperWeb.Gettext | ||
use Phoenix.HTML | ||
end |
Oops, something went wrong.