Move email template tags function to emails/functions.php. #1249