Wrapper around magicbell api to deliver notifications to your users in a background job
Add this line to your application's Gemfile:
gem "magicbell-rails"
And then execute:
$ bundle
Or install it yourself as:
$ gem install magicbell-rails
set environment variables
$ export MAGICBELL_API_KEY=your_api_key
$ export MAGICBELL_API_SECRET=your_api_secret
Magicbell::Rails.bell(
title: 'Welcome to MagicBell',
topic: 'welcome',
recipients: [
{
first_name: 'Joe',
last_name: 'Bob',
email: '[email protected]',
phone_numbers: ['+61431000000'],
external_id: '123',
custom_attributes: {
age: 30
}
}
],
content: 'The notification inbox for your product. Get started in minutes.',
category: 'new_message',
action_url: 'https://magicbell.com/docs',
custom_attributes: {
order: {
id: '1202983',
title: 'A title you can use in your templates'
}
}
).deliver_later
Contribution directions go here.
The gem is available as open source under the terms of the MIT License.