updated mailer class to allow providers