Git Product home page Git Product logo

sendgrid-sdk's Introduction

sendgrid-sdk

Master Branch Build Status

An API for interacting with SendGrid, including sending emails, validating email addresses, and receiving webhooks

Email Validation

Leverage the SendGrid API to validate email addresses. SendGrid will provide a validation result, score, and test results to help you determine the validity of an email address.

Setup

Configure your SendGrid API key credentials in the config/ColdBox.cfc file.

Note: SendGrid uses a Bearer API token header for authentication with their API. The SendGrid API Keys can have different permissions granted and email address validation is typically seperate from all other permission sets.

moduleSettings = {
    "sendgrid-sdk" = {
        emailValidationAPIKey = ""
    }
};

Methods

validate

Validate the provided email address. Returns a configured HyperRequest instance.

Name Type Required? Default Description
email String true The email address to validate
source String false An optional text string that identifies the source of the email address

Webhooks

Easily listen to webhooks using this module. Simply point Sendgrid to https://<your-server>/sendgrid/webhooks and this module will translate all Sendgrid events to ColdBox interceptors.

The following are the interceptors that are created and the Sendgrid event they correspond with:

  • onSendgridEventProcessed => processed
  • onSendgridEventDropped => dropped
  • onSendgridEventDelivered => delivered
  • onSendgridEventDeferred => deferred
  • onSendgridEventBounce => bounce
  • onSendgridEventOpen => open
  • onSendgridEventClick => click
  • onSendgridEventSpamreport => spamreport
  • onSendgridEventUnsubscribe => unsubscribe
  • onSendgridEventGroupUnsubscribe => group_unsubscribe
  • onSendgridEventGroupResubscribe => group_resubscribe

The interceptData is the data sent from Sendgrid.

Basic Authentication

SendGrid supports basic authentication when calling your webhook. To set this up, provide a username and password in your moduleSettings:

moduleSettings = {
    "sendgrid-sdk" = {
        "username" = "foo",
        "password" = "bar"
    }
};

Note: if you only a username or a password, sendgrid-sdk will return a 500 error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.