Closed nzlosh closed 7 years ago
Cool, this came up as a missing piece a few months ago.
Could you update CHANGES.md, and the version in pack.yaml
, and then we can merge it?
Thanks @LindsayHill, I've updated the pack version and changelog as requested.
Problem Stackstorm only sends an email to the first address when attempting to send to multiple destinations.
Reason The pack passes the variable
email_to
in the form of a string to the Python code. The Python code usessmtplib
which treats string types as a single address.smtplib
can process multiple addresses if they are supplied in the form of a list. So passingemail_to
as a string doesn't produce errors, but silent fails for multiple destinations.The Python code also uses
MIMEMultipart
which calls string methods directly onemail_to
. Ifemail_to
is a list, it causes exceptions to be raised.Solution By changing the data type from
email_to
to array, the field better reflects the multiple addresses nature and makes processing the address list simple and unambiguous.While this is a breaking change, I hope this patch will be accepted as the better solution for the long term.