So I've noticed some strange behaviour which I can't pinpoint why is happening.
I am using an email node to send emails. My payload is html content.
When I specify the "to" field in the email node itself, the email is sent correctly.
If I specify msg.to in any previous node (and clear the "to" field in the email node), then all of the content of the email shows up as an attachment and the email body is completely empty.
I've tried that with a function node just now. Array works in defining multiple addresses. However, the email body is still sent as an attachment instead of an actual html email.
I just figured out that if I clear out the msg. content and then create the array, the email node works. So some parameter is messing up my node. I'll come back in a bit and report.