I’m writing a demo app that involves sending email to the users when another user follows them, this is all set up and working now. My problem is that I cannot work out how to add an option in the user settings to toggle these emails from being sent (e.g the users switches them off).
Can you explain how would go about achieving this? perhaps adding a boolean field to my user model called follow_email or something along those lines?
I’ve looked through the action mailer docs and couldn’t find any info. Help would be appreciated.
update: after looking a little further it seems I should use register_inceptor, is this correct? I’d love to know how they’re implemented.
Thanks
(Rails 3.2 / Ruby 1.9.2)
Add a boolean column to the User model.
When sending the emails: