Skip to content

Commit

Permalink
Add unsubscribe link to email
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeweaver committed Dec 15, 2015
1 parent 21e809e commit 8eabf6c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/views/conflicts_mailer/conflicts_email.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
<%= render partial: 'resolved_conflict_list', locals: {conflicts: @resolved_conflicts, heading: 'Conflicts that have been resolved:'} %>
<%= render partial: 'conflict_list', locals: {conflicts: @existing_conflicts, heading: 'Existing conflicts on untouched branches:'} %>

<p>
You are receiving this email because you made a commit to the <%= @repo_name %> repo.<br>
<%= link_to 'Click here to unsubscribe.', { controller: :users, action: :unsubscribe, id: @user.id }, { style: 'text-decoration: none;' } %>
</p>
3 changes: 3 additions & 0 deletions app/views/conflicts_mailer/conflicts_email.text.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
<%= render partial: 'conflict_list', locals: {conflicts: @resolved_conflicts, heading: 'Conflicts that have been resolved:'} %>
<%= render partial: 'conflict_list', locals: {conflicts: @existing_conflicts, heading: 'Existing conflicts on untouched branches:'} %>

You are receiving this email because you made a commit to the <%= @repo_name %> repo.
To unsubscribe, click here: <%= url_for controller: :users, action: :unsubscribe, id: @user.id %>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Rails.application.routes.default_url_options[:host] = GlobalSettings.web_server_url

Rails.application.routes.draw do
get 'users/:id/unsubscribe' => 'users#unsubscribe'

Expand Down
1 change: 1 addition & 0 deletions config/settings.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cache_directory: './tmp/cache/git'
maximum_branches_to_check: 0
email_override: '' #redirect all emails to this address
email_filter: [] #only email users in this list. Empty to disable filter.
web_server_url: 'http://localhost:3000'
repos_to_check:
MyRepo:
repo_name: 'Organization/repo'
Expand Down

0 comments on commit 8eabf6c

Please sign in to comment.