diff options
| author | mo khan <mo@mokhan.ca> | 2013-07-22 12:04:10 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-07-22 12:04:10 -0600 |
| commit | b7541657a47f237ccbb86faecb18623d1c34f3e9 (patch) | |
| tree | d0a9f744a7e3a8ced6d0f8be22351d2c5e537463 /app/models | |
| parent | 795feaa3efd9fa3e3f4c29e292d618d080a29558 (diff) | |
allow signups to subscribe to a mailing list
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/sign_up.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/sign_up.rb b/app/models/sign_up.rb index faa2ab7..277d92b 100644 --- a/app/models/sign_up.rb +++ b/app/models/sign_up.rb @@ -2,4 +2,17 @@ class SignUp < ActiveRecord::Base VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false } + + def subscribe + gibbon = Gibbon.new + gibbon.list_subscribe({ + id: ENV['MAILCHIMP_LIST_ID'], + email_address: self.email, + email_type: "html", + double_optin: false, + update_existing: true, + replace_interests: false, + send_welcome: false + }) + end end |
