Closed EtienneDepaulis closed 9 years ago
Looks like the problem could be coming from the fact that if I do (after having tried at least once to save the contact):
contact = Mailjet::Contactslist_managecontact.new(contact_params)
contact.class.properties
I get: {}
Meaning that https://github.com/mailjet/mailjet-gem/blob/master/lib/mailjet/resource.rb#L235 then erase all the properties while formating the payload...
Hi @EtienneDepaulis ! thank you for using Mailjet ! I faced the issue a few days ago! strangely, it doesn't happen without rails. I will investigate and get back to you ! Thank you ! Best, Guillaume
Here is the dirty fix I found:
contact_params = {id: main_contact_list_id, action: "addnoforce", email: user.email}
contact = Mailjet::Contactslist_managecontact.create(contact_params)
Mailjet::Contactslist_managecontact.properties = [:email, :name, :action, :properties]
Mailjet::Contactdata.create(:contact_id => contact.contact_id, :data => [...])
Hahah ! dirty indeed ! I guess you could use that until I come up with a solution !
I had too, looks like Mailjet support don't give a shit about support request sadly :/
Sorry you have this feeling. we're working hard on this issue. I manage to identify the bug. I'll keep you up to date on that ! Best, Guillaume
I found out why it didn't work. A naming conflict in our wrapper. Could you tell me if this works for you on the rails_fix: branch ?
Thanks for looking into it. However, we already lost 3 hours today (and few more 2 weeks ago) with this bug. This gem should really have specs in my opinion ...
Hey ! I started implementing specs to test the wrapper. Thank you for your time. If you need anything else, I would be happy to help, otherwise, can you please close the issue ? Best, Guillaume
Has this gem been updated on Rubygems ? If not, the issue still exists ...
Hey ! @EtienneDepaulis
I am just letting you know that we released a new version on RubyGem with specs this time, and the rails_fix branch is now merged into master. We are planning to constantly grow our tests over time. Feel free to contribute if you think it lacks some useful checks !
Best, Guillaume from Mailjet !
awesome thx :)
Hello,
I'm experiencing a very weird and annoying bug using the "rails_fix branch of this gem. When I run:
I get:
But then if I want to add another user, I get this error every time:
What is really weird is I quit the rails console, then it works again but only for the first try. Then the error again ...
What am I doing wrong ??