cirandas.net

ref: master

plugins/spaminator/lib/spaminator_plugin/mailer.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class SpaminatorPlugin::Mailer < Noosfero::Plugin::MailerBase

  include Rails.application.routes.url_helpers
  def inactive_person_notification(person)
    @person = person
    @environment = person.environment
    @url = url_for(:host => person.default_hostname, :controller => 'account', :action => 'forgot_password')
    mail(
      :to => person.email,
      :from => "#{person.environment.name} <#{person.environment.noreply_email}>",
      :subject => _("[%s] You must reactivate your account.") % person.environment.name,
      :content_type => 'text/html',
    )
  end

  class Job < Struct.new(:person, :method)
    def perform
      SpaminatorPlugin::Mailer.send(method, person).deliver
    end
  end

end