Send pm instead of email on invite disable
This commit is contained in:
parent
19526c2d3f
commit
99f78ad10c
|
@ -1,16 +0,0 @@
|
||||||
class DisableInviteNotification < ActionMailer::Base
|
|
||||||
default :from => "#{Rails.application.name} " <<
|
|
||||||
"<nobody@#{Rails.application.domain}>"
|
|
||||||
|
|
||||||
def notify(user, mod, reason)
|
|
||||||
@mod = mod
|
|
||||||
@reason = reason
|
|
||||||
|
|
||||||
mail(
|
|
||||||
:from => "#{@mod.username} <nobody@#{Rails.application.domain}>",
|
|
||||||
:replyto => "#{@mod.username} <#{@mod.email}>",
|
|
||||||
:to => user.email,
|
|
||||||
:subject => "[#{Rails.application.name}] Your invite privileges have been removed"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -115,7 +115,17 @@ class User < ActiveRecord::Base
|
||||||
self.disabled_invite_by_user_id = disabler.id
|
self.disabled_invite_by_user_id = disabler.id
|
||||||
self.disabled_invite_reason = reason
|
self.disabled_invite_reason = reason
|
||||||
|
|
||||||
DisableInviteNotification.notify(self, disabler, reason)
|
msg = Message.new
|
||||||
|
msg.deleted_by_author = true
|
||||||
|
msg.author_user_id = disabler.id
|
||||||
|
msg.recipient_user_id = self.id
|
||||||
|
msg.subject = "Your invite privileges have been revoked"
|
||||||
|
msg.body = "The reason given:\n" <<
|
||||||
|
"\n" <<
|
||||||
|
"> *#{reason}*\n" <<
|
||||||
|
"\n" <<
|
||||||
|
"*This is an automated message.*"
|
||||||
|
msg.save
|
||||||
|
|
||||||
m = Moderation.new
|
m = Moderation.new
|
||||||
m.moderator_user_id = disabler.id
|
m.moderator_user_id = disabler.id
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
Invitations have been disabled for you on <%= Rails.application.name %> by <%= @mod.username %> for:
|
|
||||||
|
|
||||||
<%= word_wrap(@reason, :line_width => 72).gsub(/\n/, "\n ") %>
|
|
||||||
|
|
||||||
You can no longer allowed send invites. If you wish, you can discuss this with
|
|
||||||
the moderator by replying to this e-mail.
|
|
Loading…
Reference in a new issue