This is a late answer, but in case someone comes across this question as me, this is what I ended up with.
There is a user authentication method, which is defined as https://github.com/mailboxer/mailboxer#user-identities
If he returns the email, an email will be sent. If it returns zero, no email will be sent.
There is a notification method in the mailbox, and you can use it to send notifications like,
alice.notify("Hi","Bob has just viewed your profile!")
And in mailboxer_email check if the object is a notification or not. If so, do not send an email.
def mailboxer_email(object) if object.class==Mailboxer::Notification return nil else email end end
Here you can define more complex logic, for example, disable email for a specific type of user, etc.
source share