Skip to content
Integration of spree 1.0.0 with sendgrid newsletter API and management of subscriptions
Ruby JavaScript
Find file
Pull request Compare This branch is 14 commits ahead, 6 commits behind thms:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
config
db
lib
LICENSE
README.md
spree_sendgrid.gemspec

README.md

Spree Gift Sendgrid extension

The Spree sendgrid extension enables the use to express prferences for mail communications and subscribe to alerts and newsletters, being sent by sendgrid

Installation

  1. Add the following to your Gemfile
    gem 'spree_sendgrid'
  1. Run bundle install

  2. To setup the asset pipeline includes and copy migrations run: rails g spree_sendgrid:install

Functions

  1. Users with an account

They can opt-in / out to receive generic newsletter They can opt-in / out to receive availability alerts, e.g. when shipping to a new state becomes available They can opt-in / out to receive updates when new products become available

  1. Users without an account

They can subscribe to receive the generic newsletter (from the homepage) They can unsubscribe from within the newsletter When they create an account, their existing subscription is ported over to the account, where they can consequently manage it

Setup

  1. Create recipients lists

In order to setup the sendgrid lists, use this piece of code. It will create on list for each notification type and environment.

    require 'gatling_gun'
    sendgrid = GatlingGun.new("login", "password")
    environments = ['production','staging','development']
    kinds = ['newsletter', 'availability', 'new_product']

    environments.each do |env|
     kinds.each do |kind|
      response = sendgrid.add_list("#{kind}_#{env}")
     end
    end
Something went wrong with that request. Please try again.