Remove invitation_to_organization email

This email is no longer needed, because if user enables
assignment notifications, he/she will already receive an
email whenever he/she is added to a new organization/team (via
notifications email).
This commit is contained in:
Luka Murn 2016-10-12 10:44:03 +02:00
parent f25767fdc3
commit cccabcdd7b
5 changed files with 0 additions and 38 deletions

View file

@ -212,9 +212,6 @@ class Users::SettingsController < ApplicationController
user: @new_user_org.user, user: @new_user_org.user,
organization: @new_user_org.organization organization: @new_user_org.organization
).exists? && @new_user_org.save ).exists? && @new_user_org.save
AppMailer.delay.invitation_to_organization(@new_user_org.user,
@user_organization.user,
@new_user_org.organization)
generate_notification(@user_organization.user, generate_notification(@user_organization.user,
@new_user_org.user, @new_user_org.user,

View file

@ -5,14 +5,6 @@ class AppMailer < Devise::Mailer
default from: ENV["MAIL_FROM"] default from: ENV["MAIL_FROM"]
default reply: ENV["MAIL_REPLYTO"] default reply: ENV["MAIL_REPLYTO"]
def invitation_to_organization(user, added_by, organization, opts = {})
@user = user
@added_by = added_by
@org = organization
headers = { to: @user.email, subject: (I18n.t('mailer.invitation_to_organization.subject')) }.merge(opts)
mail(headers)
end
def notification(user, notification) def notification(user, notification)
@user = user @user = user
@notification = notification @notification = notification

View file

@ -1 +0,0 @@
<p><%=t "mailer.invitation_to_organization.text", addedBy: @added_by.name, organization: @org.name %></p>

View file

@ -1449,11 +1449,6 @@ en:
head_title: "Edit protocol" head_title: "Edit protocol"
no_keywords: "No keywords" no_keywords: "No keywords"
mailer:
invitation_to_organization:
subject: "You have been invited to team"
text: "User %{addedBy} has added you to team %{organization}."
time: time:
formats: formats:
full: "%d.%m.%Y %H:%M" full: "%d.%m.%Y %H:%M"

View file

@ -15,10 +15,6 @@ class AppMailerPreview < ActionMailer::Preview
AppMailer.invitation_instructions(fake_user, "faketoken", {}) AppMailer.invitation_instructions(fake_user, "faketoken", {})
end end
def invitation_to_organization
AppMailer.invitation_to_organization(fake_user, fake_user_2, fake_org, {})
end
private private
def fake_user def fake_user
@ -31,21 +27,4 @@ class AppMailerPreview < ActionMailer::Preview
confirmed_at: Time.now confirmed_at: Time.now
) )
end end
def fake_user_2
User.new(
full_name: "Bob Dylan",
initials: "BD",
email: "bob.dylan@gmail.com",
created_at: Time.now,
updated_at: Time.now,
confirmed_at: Time.now
)
end
def fake_org
Organization.new(
name: "Greatest musicians of all time"
)
end
end end