Skip to content

Latest commit

 

History

History
28 lines (14 loc) · 769 Bytes

File metadata and controls

28 lines (14 loc) · 769 Bytes

Google Cloud Platform logo

Google Cloud Function

Send email from Send Grid

Fork from:

https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/functions/sendgrid

Deploy

    gcloud functions deploy sendgridEmail --trigger-http

Query

    curl -X POST "https://YOUR_REGION-YOUR_PROJECT_ID.cloudfunctions.net/sendgridEmail?sg_key=send_grid_api_key" --data '{"to":"email_dest","from":"email_from","subject":"yoursubject","body":"yourbody"}' --header "Content-Type: application/json"

Run the tests

  1. Install dependencies:

     npm install
    
  2. Run the tests:

     npm test