Insynia/user_notif

View on GitHub
lib/generators/user_notif/templates/notif.rb.erb

Summary

Maintainability
Test Coverage
class <%= file_name.classify %>Notif < UserNotif::Notif
  def email?
    # Override or delete (default: true)
  end

  def template_name
    '<%= file_name %>_notif'
  end

  def email_options
    # TODO: Add this I18n key in your yml and add options or delete the method if you want to keep default values
    super({
        subject: I18n.t('notif.<%= file_name %>.subject')
      })
  end

  def target_class
    <%= target.classify %>
  end
end