cirandas.net

ref: master

plugins/admin_notifications/lib/admin_notifications_plugin/notification_helper.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
module AdminNotificationsPlugin::NotificationHelper

  def hide_notifications
    invalid_id = -1
    hide_notifications_ids = [invalid_id]
    hide_notifications_ids = JSON.parse(cookies[:hide_notifications]) unless cookies[:hide_notifications].blank?
    hide_notifications_ids
  end

  def self.substitute_variables(message, user)
    if user
      message = message.gsub("%{email}", user.person.email).gsub("%{name}", user.person.name)
    end

    message
  end

end