Last active
February 8, 2016 22:32
-
-
Save kpheasey/25def0bf1b9b0eba7159 to your computer and use it in GitHub Desktop.
Gibbon Signup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/rsvp_sxsw_controller.rb | |
class RsvpSxswController < ApplicationController | |
MAILCHIMP_API_KEY = "XXXX" | |
MAILCHIMP_LIST_ID = "XXXX" | |
# GET /rsvp_sxsw | |
def new | |
end | |
# POST /rsvp_sxsw | |
def create | |
Gibbon::Request | |
.new(api_key: MAILCHIMP_API_KEY) | |
.lists(MAILCHIMP_LIST_ID) | |
.members | |
.create(body: { | |
email_address: params[:email], | |
status: 'subscribed', | |
merge_fields: { FNAME: params[:first_name], LNAME: params[:last_name] }, | |
double_optin: false | |
}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment