Added better parameter handling for Sendgrid