Skip to content

Instantly share code, notes, and snippets.

@kpheasey
Last active February 8, 2016 22:32
Show Gist options
  • Save kpheasey/25def0bf1b9b0eba7159 to your computer and use it in GitHub Desktop.
Save kpheasey/25def0bf1b9b0eba7159 to your computer and use it in GitHub Desktop.
Gibbon Signup
# 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