Switched to templates for sending messages, added debug status messages