News for hackers. Stuff that matters.
Re:Show HN: Made a new notification tool and I'm looking for... by cyberferret on Friday May 17, 2019 @03:30AM (#19937185)
Nice work! Just signed up and am testing sending some AWS Alarms for Elastic Beanstalk via a template. One problem I've come across straight away is that your templating engine doesn't seem to be able to handle JSON arrays.

The EB notification JSON body that gets POSTed by the SNS Topic contains a Record[] structure with the messages, and when I try to setup {{ Records[0].Sns.Message }} in the template, I am getting a "template: notification-content:2: unexpected bad character U+005B '[' in command" error.

Re:Show HN: Made a new notification tool and I'm looking for... by cmaster11 on Friday May 17, 2019 @03:31AM (#19937198)
Cool!!

You can access arrays with `{{ index .myArray 0 }}` ( https://notify17.net/docs/templates/#arrays ). Notify17 uses golang templates :)

Re:Show HN: Made a new notification tool and I'm looking for... by cyberferret on Friday May 17, 2019 @05:07AM (#19937695)
Can confirm that works. :) I am not familiar with GoLang, but using {{ (index .Records 0).Sns.Message }} works (for anyone who may be interested in the solution).
Re:Show HN: Made a new notification tool and I'm looking for... by cmaster11 on Friday May 17, 2019 @06:37AM (#19938185)
Yes, I'm aware at first sight, for non Golang users, it may look a not-so-friendly syntax, but Go templates are just too powerful to not use them :D