Skip to content

thinkingserious/sendgrid-ibm-index-open-source-workshop

Repository files navigation

SendGrid Logo

Travis Badge MIT licensed

This project allows you to quickly and easily deploy a SendGrid email service utilizing IBM's Cloud Functions.

This repo is a companion to a workshop given at IBM Index 2018. The companion slides can be found here.

Table of Contents

Prerequisites & Dependencies

Installation

Update the email addresses in app.py.

bx plugin install Cloud-Functions -r Bluemix
bx login -a api.ng.bluemix.net -o <YOUR IBM CLOUD USERNAME> -s dev
docker run --rm -v "$PWD:/tmp" ibmfunctions/action-python-v3 \
   bash  -c "cd tmp && virtualenv virtualenv && source virtualenv/bin/activate && pip install -r requirements.txt"
zip -r helloSendGrid.zip virtualenv __main__.py app.py
bx wsk action create helloSendGrid --kind python-jessie:3 helloSendGrid.zip

The following is the procedure for updating your IBM Cloud Function after making a code change:

zip -r helloSendGrid.zip virtualenv __main__.py app.py
bx wsk action update helloSendGrid --kind python-jessie:3 helloSendGrid.zip

Quick Start

Go to the IBM Cloud Functions Actions page.

Click the "helloSendGrid" link.

Click the "Parameters" link.

"Add" a parameter with the "Parameter Name" SENDGRID_API_KEY and the "Parameter Value" is your SendGrid API Key.

bx wsk action invoke --result helloSendGrid

Usage

In addition the Quick Start, you can access your IBM Cloud Function using CURL.

cp .env_sample .env

Replace YOUR IBM CLOUD API KEY with your IBM Cloud API Key.

source .env

Go to the IBM Cloud Functions Actions page.

Click the "helloSendGrid" link.

Click the "Endpoints" link.

Copy the commands under "CURL" and replace API-KEY with $IBM_CLOUD_API_KEY.

Use Cases

Send an email using the command line.

Announcements

Come join me at IBM Index 2018 on 2/2/18.

Roadmap

Add the ability to pass in various paramaters such as to email, from email, subject and body.

Add Web Action and Gateway support.

Add tests.

Update documentation.

How to Contribute

I encourage contribution to this project, please see our CONTRIBUTING guide for details.

Troubleshooting

Please see the troubleshooting guide for common library issues.

About

sendgrid-ibm-index-open-source-workshop is supported by the SendGrid Developer Experience Team.

sendgrid-ibm-index-open-source-workshop is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-ibm-index-open-source-workshop are trademarks of SendGrid, Inc.

About

This project allows you to quickly and easily deploy a SendGrid email service utilizing IBM's Cloud Functions.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages