Script to send email and client side update