Class: WorkLockNotify

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
app/models/work_lock_notify.rb

Instance Method Summary collapse

Instance Method Details

#lock(user, lock_user, week, week_url, spreadsheet_url) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/models/work_lock_notify.rb', line 2

def lock(user, lock_user, week, week_url, spreadsheet_url)
  setup_email(user)

  # Email header info
  @subject += "#{lock_user.name} has marked week #{week} as locked."

  # Email body substitutions
  @body["app_name"] = UserSystem::CONFIG[:app_name].to_s
  @body["app_url"] = UserSystem::CONFIG[:app_url].to_s
  @body["name"] = "#{user.first_name} #{user.last_name}"
  @body["login"] = user.
  @body["week"] = week
  @body["lock_user"] = lock_user
  @body["week_url"] = week_url
  @body["spreadsheet_url"] = spreadsheet_url
end

#nag(user, week, week_url) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/models/work_lock_notify.rb', line 19

def nag(user, week, week_url)
  setup_email(user)

  # Email header info
  @subject += "Time sheet reminder"

  # Email body substitutions
  @body["app_name"] = UserSystem::CONFIG[:app_name].to_s
  @body["app_url"] = UserSystem::CONFIG[:app_url].to_s
  @body["name"] = "#{user.first_name} #{user.last_name}"
  @body["login"] = user.
  @body["week"] = week
  @body["week_url"] = week_url
end