Try using #blank? instead of #nil?. In all likelihood, what's happening is you're getting an empty string back from the database when it's not present.
Also, you might consider using unless instead of if !:
unless @email.blank? enkode_mail @email, @name else @name end
Ben