def safetynet(channel, filters={}, options={})
      @safetynet_channel = channel
      @safetynet_options = {
        whitelist: /@example.com/,
        email: {
          limit: 1,
          timeframe: 30.minutes
        }
      }.merge(Rails.configuration.safetynet).merge(options)

      # If class is a rails mailer, add after_action hook
      if (self.ancestors & [ActionMailer::Base]).any?
        if filters.empty?
          after_action :check_safetynet_window
        else
          after_action :check_safetynet_window, filters
        end
      end
    end
def safetynet(channel, filters={}, options={})
      @safetynet_channel = channel
      @safetynet_options = {
        whitelist: /@example.com/,
        email: {
          limit: 1,
          timeframe: 30.minutes
        }
      }.merge(Rails.configuration.safetynet).merge(options)

      # If class is a rails mailer, add after_action hook
      if (self.ancestors & [ActionMailer::Base]).any?
        if filters.empty?
          after_action :check_safetynet_window
        else
          after_action :check_safetynet_window, filters
        end
      end
    end
safetynet
   channel                     email|sms (symbol)
   filters                     Hash of method names to watch (email only) that fits after_action requirements
   options = {
     email: {                  Hash for each channel (matches to field on User model) and includes:
       limit: 1,               Maximum # of methods for this channel (default: 1)
       timeframe: 30.minutes   Minimum allowed timeframe between last method and next (default: 30.minutes)
     }
   }
   Options merges Rails.configuration.safetynet before any class-specific options