mailjet / mailjet-gem

[API v3] Mailjet official Ruby GEM
https://dev.mailjet.com
Other
130 stars 72 forks source link

Ruby API pass in array #184

Closed netwire88 closed 4 years ago

netwire88 commented 4 years ago

I'm having trouble passing an array using the Ruby API. I've followed https://www.mailjet.com/blog/news/template-error-management-mailjet/ and https://dev.mailjet.com/email/template-language/reference/ and I'm getting error: expression parsing error ## Unknown identifier: value ## near ## {{value ##

The Passport block is

   <ul>
      {% for value in var:x %}
      <li>{{value}}</li>
      {% endfor %}
</ul>

My Ruby code is

   result = Mailjet::Send.create(
        messages: [{
                       'From'=> {
                           'Email'=> "alerts@test123.com",
                           'Name'=> "TEST Alerts"
                       },
                       'To'=> [
                           {
                               'Email'=> 'test1@test123.com',
                               'Name'=> 'TEST'
                           }
                       ],
                       'TemplateID'=> 1163244,
                       'TemplateLanguage'=> true,
                       'Subject'=> "Test 3231",
                       'Variables'=> {
                           'name' => 'Test User',
                           'x' => [1, true, 'Pilot']
                       }
                   }])

I've tried changing single quotes to double quotes. I've tried using ":" instead of "=>" but nothing works. Any suggestions?

StrausT-UMG commented 3 years ago

Hi @netwire88 - did you ever get to the bottom of this issue? I am facing a similar issue with Mailjet right now.

netwire88 commented 3 years ago

No @StrausT-UMG , we switched to another SaaS company instead

StrausT-UMG commented 3 years ago

Got it @netwire88 - thank you!