Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for customization of email views #191

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ doc/
.secret
.env
.DS_Store
.byebug_history
vendor/postgresql

# Elastic Beanstalk Files
Expand Down
5 changes: 5 additions & 0 deletions app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<p>Welcome <%= @email %>!</p>

<p>You can confirm your account email through the link below:</p>

<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
7 changes: 7 additions & 0 deletions app/views/devise/mailer/email_changed.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p>Hello <%= @email %>!</p>

<% if @resource.try(:unconfirmed_email?) %>
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
<% else %>
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
<% end %>
3 changes: 3 additions & 0 deletions app/views/devise/mailer/password_change.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>Hello <%= @resource.email %>!</p>

<p>We're contacting you to notify you that your password has been changed.</p>
8 changes: 8 additions & 0 deletions app/views/devise/mailer/reset_password_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<p>Hello <%= @resource.email %>!</p>

<p>Someone has requested a link to change your password. You can do this through the link below.</p>

<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>

<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
7 changes: 7 additions & 0 deletions app/views/devise/mailer/unlock_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p>Hello <%= @resource.email %>!</p>

<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>

<p>Click the link below to unlock your account:</p>

<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
20 changes: 20 additions & 0 deletions app/views/message_mailer/new_message_email.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<h1>You have a new message: <%= @subject %></h1>
<p>
You have received a new message:
</p>
<blockquote>
<p>
<%= raw @message.body %>
</p>
</blockquote>
<p>
Visit <%= link_to root_url, root_url %> and go to your inbox for more info.
</p>
</body>
</html>
10 changes: 10 additions & 0 deletions app/views/message_mailer/new_message_email.text.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
You have a new message: <%= @subject %>
===============================================

You have received a new message:

-----------------------------------------------
<%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>
-----------------------------------------------

Visit <%= root_url %> and go to your inbox for more info.
20 changes: 20 additions & 0 deletions app/views/message_mailer/reply_message_email.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<h1>You have a new reply: <%= @subject %></h1>
<p>
You have received a new reply:
</p>
<blockquote>
<p>
<%= raw @message.body %>
</p>
</blockquote>
<p>
Visit <%= link_to root_url, root_url %> and go to your inbox for more info.
</p>
</body>
</html>
10 changes: 10 additions & 0 deletions app/views/message_mailer/reply_message_email.text.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
You have a new reply: <%= @subject %>
===============================================

You have received a new reply:

-----------------------------------------------
<%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>
-----------------------------------------------

Visit <%= root_url %> and go to your inbox for more info.
20 changes: 20 additions & 0 deletions app/views/notification_mailer/new_notification_email.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<h1>You have a new notification: <%= @notification.subject.html_safe? ? @notification.subject : strip_tags(@notification.subject) %></h1>
<p>
<%= t('mailboxer.notifications.new.intro') %>
</p>
<blockquote>
<p>
<%= raw @notification.body %>
</p>
</blockquote>
<p>
Visit <%= link_to root_url, root_url %> and go to your notifications for more info.
</p>
</body>
</html>
10 changes: 10 additions & 0 deletions app/views/notification_mailer/new_notification_email.text.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
You have a new notification: <%= @notification.subject.html_safe? ? @notification.subject : strip_tags(@notification.subject) %>
===============================================

You have received a new notification:

-----------------------------------------------
<%= @notification.body.html_safe? ? @notification.body : strip_tags(@notification.body) %>
-----------------------------------------------

Visit <%= root_url %> and go to your notifications for more info.
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ en:
fr: "Français"
time:
ago: "%{time} ago"

community_offers:
new_header: "Create a new Community Offer"
name_label: "Title"
Expand Down Expand Up @@ -278,6 +279,9 @@ en:
user_updated: "Account updated successfully!"
mailboxer:
sent: "Message sent!"
notifications:
new:
intro: 'You have received a new notification:'
currencies:
cash: "Cash"
cheque: "Cheque"
Expand Down