Closed judemoutiez closed 8 years ago
Hey @judemoutiez !
I added the id
field that was missing in the appropriate resource. Thanks :)
Can you ensure this works for you before I merge it into the master branch ?https://github.com/mailjet/mailjet-gem/blob/nlsend/lib/mailjet/resources/newsletter_send.rb#L10
Thanks, Guillaume :airplane:
Hello @GuillaumeBadi , thanks for your answer !
I just tested on branch 'nlsend' and it seems that the issue remains, here is the full error
NameError: undefined local variable or method id' for #<Mailjet::Newsletter_detailcontent:0x007fb59720c9d0> /Library/Ruby/Gems/2.0.0/bundler/gems/mailjet-gem-94de887d6fde/lib/mailjet/resource.rb:286:in
method_missing'
/Library/Ruby/Gems/2.0.0/bundler/gems/mailjet-gem-94de887d6fde/lib/mailjet/resource.rb:203:in save' /Library/Ruby/Gems/2.0.0/bundler/gems/mailjet-gem-94de887d6fde/lib/mailjet/resource.rb:230:in
update_attributes'
Thanks !
Hey @judemoutiez !
I am just letting you know that I am currently working on that. :) Thank you for your patience.
Regards, Guillaume
It should finally be working, can you confirm that on your side so I can merge to master ? :airplane: It works for me.
Best, Guillaume
Hello @GuillaumeBadi , here is the error I get now :
"{ \"ErrorInfo\" : \"\", \"ErrorMessage\" : \"Invalid json input: object \"\"->\"TNewsLetterSend\" property \"Id\" is not a class property, but tkInt64\", \"StatusCode\" : 400 }"
Do you have an idea ? Is it on my side ?
Ok I managed to spot the issue here.
inside the code, the id was sent during the post as a payload, and contacts_list_id was instead 'ContactsListId'. But anyway your code snippet should work now :)
Still on the NLSEND branch :)
Let me know if anything else blocks you
Best, Guillaume :airplane:
I'll test this as soon as possible thanks !
What about this one ? :) Did it work for you ?
@GuillaumeBadi I faced the same issue described above when trying to add body to newletter ( http://dev.mailjet.com/guides/?ruby#prepare-a-newsletter)
For information I'm using the Github master version.
Hey @Maroo-b ! Can you paste your code here so I can try to reproduce your error ?
@GuillaumeBadi thanks for the fast reply :) , it's the same code from official documentation:
newsletter = Mailjet::Newsletter.create(locale: "en_US",sender: "MisterMailjet",sender_email: "test@test.com",subject: "Greetings from Mailjet",contacts_list_id: 1614627,title: "api test")
target = Mailjet::Newsletter_detailcontent.find(newsletter.id) target.update_attributes(html_part: "Hello <strong>world</strong>!",text_part: "Hello world!")
Error msg: undefined local variable or method `id' for #Mailjet::Newsletter_detailcontent:0x007ff794a640a8
Can you try now ? I pushed it on master. I will do the release after a few tests
@GuillaumeBadi the update is working now, thx :) I suggest to add a regression test for this case to avoid facing this bug again, is it possible ?
You are 100% right, This was broken because of the last release, so I guess its time to add more tests :)
Hi everyone,
I'm trying to send a marketing campaign and am following the documentation.
First of all, my newsletter is not creating with a contact list, even though the ID I am inputing is valid.
Then, when I try to update Newsletter_detailcontent to add Html content, this issue is sent : NameError: undefined local variable or method `id' for #Mailjet::Newsletter_detailcontent:0x007ffb70a5a910
Here is my code :
Where am I mistaken ?
Also, what is the easiest way to add more "complex" html code as content instead of "one liners" like the hello world ?
Thanks !