Alters changes test mail function to use the generate function.