Class: EmailParams::InvalidEmployeeEmailParams

Inherits:
BaseEmailParams show all
Defined in:
app/notifications/email_params/invalid_employee_email_params.rb

Instance Attribute Summary

Attributes inherited from BaseEmailParams

#event_notification_configuration, #recipient, #reference_event

Instance Method Summary collapse

Methods inherited from BaseEmailParams

#from, #initialize, #template_name, #to

Constructor Details

This class inherits a constructor from EmailParams::BaseEmailParams

Instance Method Details

#company_nameObject



15
16
17
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 15

def company_name
  company.company_name_e
end

#dearObject



7
8
9
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 7

def dear
  recipient.user_name
end

#employee_nameObject



11
12
13
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 11

def employee_name
  employee.employee_name
end

#employee_urlObject



27
28
29
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 27

def employee_url
  employee.url
end

#error_messagesObject



31
32
33
34
35
36
37
38
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 31

def error_messages
  raise 'Invalid employee is valid' if employee.valid?

  messages = employee.errors.full_messages
  raise 'Invalid employee has no error messages' if messages.empty?

  messages
end

#formatted_event_start_dateObject



23
24
25
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 23

def formatted_event_start_date
  reference_event.formatted_created_date
end

#formatted_start_dateObject



19
20
21
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 19

def formatted_start_date
  employee.formatted_start_date
end

#subjectObject



3
4
5
# File 'app/notifications/email_params/invalid_employee_email_params.rb', line 3

def subject
  I18n.t('emails.invalid_employee.subject')
end