service_packs_mailer.rb 572 Bytes
Newer Older
Tam Le's avatar
Tam Le committed
1
class ServicePacksMailer < ApplicationMailer
2
  default from: 'op@example.com'
Khang Le's avatar
Khang Le committed
3

Tam Le's avatar
Tam Le committed
4
5
6
7
8
9
  def expired_email(user, service_pack)
    @user = user
    @sp = service_pack
    # binding.pry

    mail to: @user.mail, subject: "The service pack #{@sp.name} has expired" do |format|
Khang Le's avatar
Khang Le committed
10
11
      format.text
      format.html
Tam Le's avatar
Tam Le committed
12
13
    end
  end
Khang Le's avatar
Khang Le committed
14

Tam Le's avatar
Tam Le committed
15
  def notify_under_threshold1(user, service_pack)
Khang Le's avatar
Khang Le committed
16
17
    @user = user
    @sp = service_pack
18
    # binding.pry
Tam Le's avatar
Tam Le committed
19
    mail to: @user.mail, subject: "The service pack #{@sp.name} is running out" do |format|
Khang Le's avatar
Khang Le committed
20
21
      format.text
      format.html
Tam Le's avatar
Tam Le committed
22
23
24
    end
  end
end