{"action":"created","issue":{"url":"https://api.github.com/repos/brack3t/Djrill/issues/92","labels_url":"https://api.github.com/repos/brack3t/Djrill/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/brack3t/Djrill/issues/92/comments","events_url":"https://api.github.com/repos/brack3t/Djrill/issues/92/events","html_url":"https://github.com/brack3t/Djrill/issues/92","id":78888880,"number":92,"title":"How to use handlebars loops with Djrill","user":{"login":"kevgathuku","id":3721994,"avatar_url":"https://avatars.githubusercontent.com/u/3721994?v=3","gravatar_id":"","url":"https://api.github.com/users/kevgathuku","html_url":"https://github.com/kevgathuku","followers_url":"https://api.github.com/users/kevgathuku/followers","following_url":"https://api.github.com/users/kevgathuku/following{/other_user}","gists_url":"https://api.github.com/users/kevgathuku/gists{/gist_id}","starred_url":"https://api.github.com/users/kevgathuku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevgathuku/subscriptions","organizations_url":"https://api.github.com/users/kevgathuku/orgs","repos_url":"https://api.github.com/users/kevgathuku/repos","events_url":"https://api.github.com/users/kevgathuku/events{/privacy}","received_events_url":"https://api.github.com/users/kevgathuku/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-21T08:25:59Z","updated_at":"2015-05-23T11:33:30Z","closed_at":"2015-05-23T11:33:30Z","body":"Hi,\r\nI am having some trouble with inserting some dynamic content in my templates.\r\nI am trying to pass multiple objects to the template in order to use the for loops feature in Mandrill templates. I followed the [examples](http://blog.mandrill.com/handlebars-for-templates-and-dynamic-content.html#examples) and I am not able to pass multiple elements in the merge vars.\r\nThis is my attempt so far:\r\n```\r\nmsg.merge_vars = {'users': []}\r\nfor user in user_list:\r\n            msg.merge_vars['users'].append(\r\n                {\r\n                    'name': user.first_name,\r\n                    'role': user.role,\r\n                    'id': user.id\r\n                })\r\n```\r\nThe corresponding template has a handlebars for loop that iterates over the users and displays the info.\r\n\r\nWhat would be the best way to implement passing multiple elements to the template under a single key?\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/brack3t/Djrill/issues/comments/104883825","html_url":"https://github.com/brack3t/Djrill/issues/92#issuecomment-104883825","issue_url":"https://api.github.com/repos/brack3t/Djrill/issues/92","id":104883825,"user":{"login":"kevgathuku","id":3721994,"avatar_url":"https://avatars.githubusercontent.com/u/3721994?v=3","gravatar_id":"","url":"https://api.github.com/users/kevgathuku","html_url":"https://github.com/kevgathuku","followers_url":"https://api.github.com/users/kevgathuku/followers","following_url":"https://api.github.com/users/kevgathuku/following{/other_user}","gists_url":"https://api.github.com/users/kevgathuku/gists{/gist_id}","starred_url":"https://api.github.com/users/kevgathuku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevgathuku/subscriptions","organizations_url":"https://api.github.com/users/kevgathuku/orgs","repos_url":"https://api.github.com/users/kevgathuku/repos","events_url":"https://api.github.com/users/kevgathuku/events{/privacy}","received_events_url":"https://api.github.com/users/kevgathuku/received_events","type":"User","site_admin":false},"created_at":"2015-05-23T11:33:30Z","updated_at":"2015-05-23T11:33:30Z","body":"Thanks. Using `global_merge_vars` fixed it."}}