added code for sendgrid and mandril