Sha256: c541dcff0f5186e0c965843ace06e62f75740d7c6f9a72a225f66ad0dc696c24
Contents?: true
Size: 1.56 KB
Versions: 1
Compression:
Stored size: 1.56 KB
Contents
# Mailstro Client for Ruby A quick and easy way to send emails from your ruby application. ## Installation 1. Add the `mailstro` gem to your `Gemfile` ```ruby gem "mailstro" ``` 2. Install the gem ```shell bundle install ``` 3. Configure the mailstro module with your API key. In rails apps, put this code to a new file at `config/initializers/mailstro.rb` ```ruby Mailstro.configure do |config| config.api_key = "YOUR_API_KEY_HERE" end ``` By default, mailstro operates in test mode. This ensures accidental emails are not sent in development or staging environments. In rails apps, put this code to a new file at `config/environments/production.rb` ```ruby # Enable production mode, and start sending real emails. Mailstro.configure do |config| config.enabled = true end ``` ## Usage Sending a basic email. ```ruby Mailstro.deliver(:welcome, :to => 'shanon@mailstroapp.com', :data => { :coupon_code => 'THANKS01' } ) ``` ## RSpec Require the mailstro spec helper to automatically enable test mode. ```ruby require 'mailsto/rspec' ``` Verify emails are being sent with simple matchers. ```ruby Mailstro.deliver(:welcome, :to => 'shanon@mailstroapp.com' ) Mailstro.should have_delivered(:welcome, :to => 'shanon@mailstroapp.com' ) ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mailstro-0.1.0 | Readme.md |