lib/notification_engine/mediums/base.rb
# finds the template in en.yml
# for example, finds the email body for
# the CalendarChangeNotification
finds the template in en.yml
for example, finds the email body for
the CalendarChangeNotification
finds the template in en . yml for example finds the email body for the CalendarChangeNotification
def find_template(template_name, options = {})
        medium = options.fetch(:medium, slug)
        template_path = "#{localization_path}.#{medium}.#{template_name}"
        if I18n.exists?(template_path, :en)
          template = I18n.t(template_path)
        else
          options_for_all = { medium: :all, original_path: template_path }
          return find_template(template_name, options_for_all) if medium == slug
          raise "template not found: #{options[:original_path]}. Please check en.yml"
        end
        template
      end
def find_template ( template_name , options = { } ) medium = options . fetch ( :medium , slug ) template_path = "#{localization_path}.#{medium}.#{template_name}" if I18n . exists? ( template_path , :en ) template = I18n . t ( template_path ) else options_for_all = { medium : :all , original_path : template_path } return find_template ( template_name , options_for_all ) if medium == slug raise "template not found: #{options[:original_path]}. Please check en.yml" end template end
finds the template in en.yml
for example, finds the email body for
the CalendarChangeNotification
finds the template in en . yml for example finds the email body for the CalendarChangeNotification
template_name
<not_specific>
options
<not_specific>