Class: Sincerely::Templates::NotificationTemplate

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/sincerely/templates/notification_template.rb

Overview

rubocop:disable Rails/ApplicationRecord

Direct Known Subclasses

EmailLiquidTemplate

Instance Method Summary collapse

Instance Method Details

#render(content_type, options = {}) ⇒ Object



12
13
14
15
# File 'lib/sincerely/templates/notification_template.rb', line 12

def render(content_type, options = {})
  content = public_send("#{content_type}_content") || ''
  renderer.render(content, options&.stringify_keys)
end

#renderer ⇒ Object



17
18
19
# File 'lib/sincerely/templates/notification_template.rb', line 17

def renderer
  raise 'Method should be implemented in concrete class'
end