Your example is extremely simple and could work for a new coder but once things get just slightly more complicated things get messy. I can already find exceptions in your very simple example: how exactly are user supposed to be alerted? Do all users have a mobile number so they can be texted? If not do you try email? What if they are online, do you send an im-message? Should you send to all available addresses? In which order do you prioritize message if you only send to the first available destination, email first or sms first?