Skip to content

rutkat/sendgrid-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SendGrid-demo

SendGrid Logo Travis Badge MIT licensed

This project allows you to deploy a SendGrid email service

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.

Releases

No releases published

Packages

No packages published