Closed terebentina closed 6 years ago
Thanks for the PR!
You're right webhookUrl
can be seen as the to
field.
About webhookUrl
being an array
: it can't be the case by design (email.to
is also a string
) to make templating easier (https://github.com/notifme/notifme-template) and other (maybe future) functionalities.
The initial slack provider had 2 limitations:
notifme-sdk
:to
emails in the email provider - there should be a single slack provider set up but able to send to various recipients. This case wasn't covered by the existing slack provider but it is with these changes.I made the
webhookUrl
in the slack config optional. Either the config, or thesend
payload must specify a webhookUrl. To be honest, I would like webhookUrl in the payload to be either a string or an array eventually, so we can send to more hooks at once, just like we can send to morecc
orbcc
recipients in emails. The difference would be thatnotifme-sdk
would have to fire multiplefetch
requests in this case.