Class: LeadNotifications::ControllerHooks
- Inherits:
-
Salesflip::Callback::Base
- Object
- Salesflip::Callback::Base
- LeadNotifications::ControllerHooks
- Defined in:
- lib/app/lead_notifications/lib/controller_hooks.rb
Instance Method Summary collapse
Instance Method Details
#app_after_filter(controller, context = {}) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/app/lead_notifications/lib/controller_hooks.rb', line 2 def app_after_filter( controller, context = {} ) return unless controller.controller_name == 'leads' && controller.action_name == 'create' lead = controller.instance_variable_get("@lead") if lead && lead.valid? && !controller.request.format.html? LeadNotifications::LeadNotificationMailer.lead_notification(lead).deliver end end |