Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method 'add_user_to_mailchimp' missing after invitation #58

Open
rvgarimrj opened this issue Feb 24, 2015 · 0 comments
Open

Method 'add_user_to_mailchimp' missing after invitation #58

rvgarimrj opened this issue Feb 24, 2015 · 0 comments

Comments

@rvgarimrj
Copy link

I´m getting the following error after invitation button is clicked:

Parameters: {"user"=>{"email"=>"[email protected]"}}
(0.1ms) begin transaction
User Exists (0.1ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = '[email protected]' LIMIT 1
SQL (2.7ms) INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "last_sign_in_at", "last_sign_in_ip", "name", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "unconfirmed_email", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ["confirmation_sent_at", nil], ["confirmation_token", nil], ["confirmed_at", nil], ["created_at", Tue, 24 Feb 2015 05:57:33 BRT -03:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "[email protected]"], ["encrypted_password", ""], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["name", nil], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["sign_in_count", 0], ["unconfirmed_email", nil], ["updated_at", Tue, 24 Feb 2015 05:57:33 BRT -03:00] rollback transaction
Completed 500 Internal Server Error in 1923ms

Gibbon::MailChimpError - Signup disabled for "[email protected]":
(gem) gibbon-1.1.5/lib/gibbon/api_category.rb:47:in call' (gem) gibbon-1.1.5/lib/gibbon/api_category.rb:57:inmethod_missing'
app/models/user.rb:66:in `add_user_to_mailchimp'
.....

private
def add_user_to_mailchimp
return if email.include?(ENV['ADMIN_EMAIL'])
mailchimp = Gibbon::API.new(ENV['MAILCHIMP_API_KEY'])
result = mailchimp.lists.subscribe({
:id => ENV['MAILCHIMP_LIST_ID'],
:email => {:email => self.email},
:double_optin => false,
:update_existing => true,
:send_welcome => true
})
Rails.logger.info("Subscribed #{self.email} to MailChimp") if result
end

All variables are set on application.yml and the method is correct at user.rb. What could be causing this ?
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant