FREEPBX-6914 and create notification object outside of the if statement