Code Monkey home page Code Monkey logo

sendgrid_notification's Introduction

SendgridNotification

SendgridNotification is engine of Ruby on Rails, and notification mail (e.g. account registration, logging in by new devise, reminder, etc...) sender and utility, using SendGrid API.

This provides mail utility models, migrations, and rake tasks.

Installation / Usage

First, add sendgird_notification in Gemfile

gem 'sendgrid_notification'
bundle install

Then, generate migration files and migrate

bin/rails sendgrid_notification_engine:install:migrations
bin/rails db:migrate

Generate and edit controllers for NotificationMail CRUD

...

Create NotificationMail record. key = 'example'

...

And send the mail

...

Oops. It lacks SendGrid API configuration. Get API key from sendgrid.com and set it ENV['SENDGRID_API_KEY']

...

Make subclasses for each notification_mail key

...

Validate mail template has right parameter name

...

Configuration

Name Description Default Value
config.sendgrid_notification.api_key SendGrid API Key ENV['SENDGRID_API_KEY']
config.sendgrid_notification.mail_from FROM address of notification mail ENV['SENDGRID_MAIL_FROM']
config.sendgrid_notification.mail_from_name FROM name of notification mail ENV['SENDGRID_MAIL_FROM_NAME']
config.sendgrid_notification.mailer Mailer class name (by string). usually no need to change "SendgridNotification::SendgridMailer"

Rake tasks

Task Description ENV/Parameter
sendgrid_notification:send Send mail TO=[recipient email address] KEY=[mail type key] ... and mail parameters
sendgrid_notification:status:autoupdate Update status from previous autoupdate task
sendgrid_notification:status:retrieve Only retrieve suppression statuses in start..end start=[datetime] end=[datetime]
sendgrid_notification:status:update Retrieve suppression status and update record start=[datetime] end=[datetime]
sendgrid_notification:testmail:init Create notification_mails test record. default key = "_test"
sendgrid_notification:testmail:send Send testmail TO=[recipient email address] [body=body]

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.

sendgrid_notification's People

Contributors

holysugar avatar rastamhadi avatar

Watchers

James Cloos avatar Dueno avatar  avatar

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.