Fix email config and basic email template