Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A "subscribe to newsletter" helper for rails, integrated with madmimi
Ruby JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
lib
test
.gitignore
Gemfile
Gemfile.lock
MIT-LICENSE
README.rdoc
Rakefile
madmimi_subscribe_form.gemspec

README.rdoc

MadmimiSubscribeForm

This gem adds the helper madmimi_subscribe_form, which generates a form for subscribing to a newsletter

Installation

Add the gem to your Gemfile

gem 'madmimi_subscribe_form'

Create a file in config/initializers with your Madmimi credentials, and the newsletter name

MadmimiSubscribeForm.config do |config|
  config.email = "your_email"
  config.api_key = "your_api_key"
  config.newsletter = "your_newsletter_name"
end

Call the helper in your views

<%= madmimi_subscribe_form %>

Customisation

Locales

The following locales are already defined, but you are free to modify them:

madmimi_subscribe_form.enter_email: "Enter your email"
madmimi_subscribe_form.success_message: "You have been successfully added to the newsletter"

Form

The included form is minimalistic, but you can replace it by overwriting the partial app/views/shared/_madmimi_subscribe_form.html.erb

Basically, all you need is a POST request to /newsletter/subscribe, with an “email” param.

Something went wrong with that request. Please try again.