Update sendgrid function