First time using SendGrid

Aya Komuro
3 min readDec 4, 2016

--

This is blog post for SendGrid Advent Calendar (see blow)

There is no big reason why I wrote this in English. It’s just in the mood.

First of all, I had never used SendGrid before even many people using it for production. Only thing that I knew of were SendGrid is API controllable SMTP service and Kansuke-san is an evangelist of it.

Yes, I’ve tried it out finally last week with 3 hours or so. and these are digest of what I learned.

  • Sign up SendGrid is not something like being anonymous
  • Oh-la! Easy send out email by Python
  • Easy integration with Datadog

Sign up SendGrid is not something like being anonymous

If you want to use SendGrid, you need to wait for approval from SendGrid (or area managed partner’s company) to use it. It’s obvious reason that they don’t want SPAM to use their service.

But we’ve already used to be an anonymous to sign up web services as long as you have an email address (there are a ton of free email addresses to use) or cellphone. I felt it’s like a last judgement!

By the way, when you sign up with SendGrid in Japan, your id will be “something@kke.com”.

Oh-la! Easy send out email by Python

I bet you find out SendGrid documentation and help page to start. Only thing I know is API Key, and it’s only thing that I wanted to know at first time.

Go to Setting > API Keys and generate key.

Open terminal, and install packages.

$ pyenv local
3.5.2
$ pip install sendgrid
$ pip install datadog

See python code on Github. Copy&paste or type and execute it. Oh..my…easy….Too easy to send email without setup SMPT locally.

Easy integration with Datadog

I thought maybe it might be good idea to see how many email send out from SendGrid on Datadog.

import sendgrid#snipif response.status_code == 202:
statsd.increment(‘email.send’)

See data format and functions that StatsD can send to.

Here is easy graph of email send out from SendGrid.

🤔 I might need to explore more about Datadog StatsD.

What’s next?

SendGrid is too easy to use after you pass its last judgement! I should have some web application just for send email to users via SendGrid.

I will look more about Datadog StatsD next time!

--

--

Aya Komuro

Professional #Cloud #AWS Personal: #Travel #Art #Gym ayakomuro@gmail http://blog.popowa.com