From 1d36ee03b22f22b2d1b2c0f6408a70be498ca882 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 25 Nov 2016 15:05:07 -0500 Subject: [PATCH] send mailboxer notifications as emails if user doesn't have emails disabled --- app/models/user.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index dab54974..ef11e5f6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -111,8 +111,14 @@ class User < ApplicationRecord self[:settings] = val end - def mailboxer_email(_object) - nil # email + # Mailboxer hooks and helper functions + + def mailboxer_email(_message) + if emails_allowed + email + else + nil + end end def mailboxer_notifications