Adds cacheing to the email function