(recipients)
| 137 | } |
| 138 | |
| 139 | function generateHeaderTo(recipients) { |
| 140 | // if a recipient has a header_to then it is cc'd or bcc'd and we don't want it in the header_to value |
| 141 | const originalRecipients = _.filter(recipients, (recipient) => !_.has(recipient.address, 'header_to')); |
| 142 | |
| 143 | return _.map(originalRecipients, (recipient) => addressToString(recipient.address)).join(', '); |
| 144 | } |
| 145 | |
| 146 | function addressToString(address) { |
| 147 | if (_.isPlainObject(address)) { |
no test coverage detected