https://github.com/madetech/createsend-rails
Smart Transactional Emails for Campaign Monitor in Rails
https://github.com/madetech/createsend-rails
Last synced: about 1 year ago
JSON representation
Smart Transactional Emails for Campaign Monitor in Rails
- Host: GitHub
- URL: https://github.com/madetech/createsend-rails
- Owner: madetech
- License: mit
- Created: 2016-05-11T15:03:39.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-09-17T15:00:05.000Z (over 5 years ago)
- Last Synced: 2025-03-26T06:51:09.372Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 33.2 KB
- Stars: 3
- Watchers: 4
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Campaign Monitor - Smart Transactional Emails for Rails
[](https://codeclimate.com/github/madetech/createsend-rails) [](https://travis-ci.org/madetech/createsend-rails) [](https://codeclimate.com/github/madetech/createsend-rails/coverage)
The `create_send_rails` Gem drops into ActionMailer and sends transactional emails via the [Campaign Monitor API](https://www.campaignmonitor.com/api/), using its [Smart Email](https://www.campaignmonitor.com/api/transactional/#send_a_smart_email) feature.
It updates ActionMailer so it defaults to JSON mailer views and allows you to define the data required for each of your mailers.
## Getting Started
To get started, add the following line to your applications `Gemfile`:
```ruby
gem 'createsend-rails'
```
Then update your environment files and set `delivery_method` to `create_send` and include your CampaignMonitor `api_key` within the settings block.
```ruby
config.action_mailer.delivery_method = :create_send
config.action_mailer.create_send_settings = {
api_key: 'INSERT_API_KEY'
}
```
Now go into your `views/*_mailer/` and add a `.json` view, which defines the data attributes required by your Smart Email template. Below is an example of a password reset email.
```json
{
"smart_email_id": "SMART_EMAIL_ID",
"language": "<%= @user.language %>",
"name": "<%= @user.name %>",
"reset_url": "<%= @edit_password_reset_url %>"
}
```
## Credits

Developed and maintained by [Made Tech Ltd](https://www.madetech.com/). Key contributions:
* [Andrew Scott](https://github.com/askl56)
* [Rory MacDonald](https://github.com/rorymacdonald)
* [Seb Ashton](https://github.com/SebAshton)
## License
Copyright © 2016 [Made Tech Ltd](https://www.madetech.com/). It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.