Fix the setting of email variables