Class: EmailParams::BaseEmailParams
- Inherits:
-
Object
- Object
- EmailParams::BaseEmailParams
- Defined in:
- app/notifications/email_params/base_email_params.rb
Direct Known Subclasses
EmployeesWithoutTimesheetsEmailParams, InvalidEmployeeEmailParams, InvalidInvoiceEmailParams, NewLoadTenderEmailParams, PayrollPeriodWithoutTransactionEmailParams, UncompletedCompanySetupEmailParams, UnreviewedPayrollTransactionEmailParams
Instance Attribute Summary collapse
-
#event_notification_configuration ⇒ Object
readonly
Returns the value of attribute event_notification_configuration.
-
#recipient ⇒ Object
readonly
Returns the value of attribute recipient.
-
#reference_event ⇒ Object
readonly
Returns the value of attribute reference_event.
Instance Method Summary collapse
- #formatted_event_start_date ⇒ Object
- #from ⇒ Object
-
#initialize(event_notification_configuration:, reference_event:, recipient:) ⇒ BaseEmailParams
constructor
A new instance of BaseEmailParams.
- #subject ⇒ Object
- #template_name ⇒ Object
- #to ⇒ Object
Constructor Details
#initialize(event_notification_configuration:, reference_event:, recipient:) ⇒ BaseEmailParams
Returns a new instance of BaseEmailParams.
5 6 7 8 9 10 11 12 13 |
# File 'app/notifications/email_params/base_email_params.rb', line 5 def initialize( event_notification_configuration:, reference_event:, recipient: ) @event_notification_configuration = event_notification_configuration @reference_event = reference_event @recipient = recipient end |
Instance Attribute Details
#event_notification_configuration ⇒ Object (readonly)
Returns the value of attribute event_notification_configuration.
3 4 5 |
# File 'app/notifications/email_params/base_email_params.rb', line 3 def event_notification_configuration @event_notification_configuration end |
#recipient ⇒ Object (readonly)
Returns the value of attribute recipient.
3 4 5 |
# File 'app/notifications/email_params/base_email_params.rb', line 3 def recipient @recipient end |
#reference_event ⇒ Object (readonly)
Returns the value of attribute reference_event.
3 4 5 |
# File 'app/notifications/email_params/base_email_params.rb', line 3 def reference_event @reference_event end |
Instance Method Details
#formatted_event_start_date ⇒ Object
32 33 34 |
# File 'app/notifications/email_params/base_email_params.rb', line 32 def formatted_event_start_date reference_event.formatted_created_date end |
#from ⇒ Object
19 20 21 |
# File 'app/notifications/email_params/base_email_params.rb', line 19 def from Rails.application.config.from_email_address end |
#subject ⇒ Object
15 16 17 |
# File 'app/notifications/email_params/base_email_params.rb', line 15 def subject raise NotImplementedError end |
#template_name ⇒ Object
27 28 29 30 |
# File 'app/notifications/email_params/base_email_params.rb', line 27 def template_name event_slug = @reference_event.slug event_slug.downcase end |
#to ⇒ Object
23 24 25 |
# File 'app/notifications/email_params/base_email_params.rb', line 23 def to @recipient.email end |