sensu/sensu-community-plugins — pull request #634 by oba11 (2014-06-15 17:25:38+00:00)
Title: replaced client_subscriptions loop with check_subscribers loop

Hi @zarry, made a little change to the mail_to with multiple subscriptions.
I figured out that if a client is many subscriptions, the mail_to reads the client subscriptions instead of the event subscription. This causes email to go to wrong recipients.

Lets say client node a has subscriptions `"subscriptions"=>["nginx", "haproxy", "all"]`.
I created a mail_to `mailer: { "subscriptions": { "nginx": { "mail_to": "sys@example.com" }, "haproxy": { "mail_to": "dev@example.com" } } }` and an `event on nginx` happens, the current script reads client subscriptions and send it to sys and dev. My fix makes sure its sent to ony sys only.

Let me know what you think about the modification.
Thanks.