Updating cloud function for sending an email upon succesful purchase