1
0
Fork 0
Test your dynamic sendgrid templates
Go to file
Tim Kächele c644ddbe8d Implement email search 2020-12-11 20:00:57 +01:00
.screenshots First commit 2020-12-06 21:05:11 +01:00
app Implement email search 2020-12-11 20:00:57 +01:00
bin First commit 2020-12-06 21:05:11 +01:00
config Implement email search 2020-12-11 20:00:57 +01:00
db First commit 2020-12-06 21:05:11 +01:00
lib First commit 2020-12-06 21:05:11 +01:00
log First commit 2020-12-06 21:05:11 +01:00
public First commit 2020-12-06 21:05:11 +01:00
storage First commit 2020-12-06 21:05:11 +01:00
test First commit 2020-12-06 21:05:11 +01:00
tmp First commit 2020-12-06 21:05:11 +01:00
vendor First commit 2020-12-06 21:05:11 +01:00
.browserslistrc First commit 2020-12-06 21:05:11 +01:00
.gitignore First commit 2020-12-06 21:05:11 +01:00
.ruby-version First commit 2020-12-06 21:05:11 +01:00
Gemfile First commit 2020-12-06 21:05:11 +01:00
Gemfile.lock First commit 2020-12-06 21:05:11 +01:00
LICENSE.txt First commit 2020-12-06 21:05:11 +01:00
README.md First commit 2020-12-06 21:05:11 +01:00
Rakefile First commit 2020-12-06 21:05:11 +01:00
babel.config.js First commit 2020-12-06 21:05:11 +01:00
config.ru First commit 2020-12-06 21:05:11 +01:00
package.json First commit 2020-12-06 21:05:11 +01:00
postcss.config.js First commit 2020-12-06 21:05:11 +01:00
yarn.lock First commit 2020-12-06 21:05:11 +01:00

README.md

PostDoc

PostDoc is a sendgrid mock api server that allows you to test your dynamic sendgrid templates in development or staging environments written in Ruby on Rails.

What it does?

It provides you with a mock api for sending emails and an accompanying web interface to inspect the sent emails.

It validates the request payload with the sendgrid sandbox mode to check that all inputs are correct and then renders your html/plain text handlebars templates with the provided personalizations.

What you need?

  • a valid sendgrid api token

Configuration

PostDoc generates a mock sendgrid api token for you, that you have to pass to your sendgrid api client library, additionally you have to override the host with the host where you run postdoc.

In ruby that looks something like this:

SendGrid::API.new(api_key: 'YOUR_POSTDOC_MOCK_TOKEN',
                  host: 'POSTDOC_HOST')

Dependencies

  • Ruby Version (MRI) 2.7.2
  • Postgresql 12.3
  • Node

Setup

Install the correct ruby version

$ rvm install 2.7.2

Install the ruby dependencies

$ bundle install --jobs=64

Create your database file and fill in your postgres username/password

$ cp config/database.yml.example config/database.yml

Setup the database

$ bundle exec rails db:setup

Install the frontend dependencies

$ yarn install --check-files

Start a server

$ bundle exec rails server

Credentials

The username/password for accessing the user interface in development mode are:

username: postdoc
password: postdoc

You can override them in config/secrets.

Screenshots

PostDoc-Screenshot