Moved debug mailgun to a function