MCPcopy Create free account
hub / github.com/SparkPost/node-sparkpost / generateHeaderTo

Function generateHeaderTo

lib/transmissions.js:139–144  ·  view source on GitHub ↗
(recipients)

Source from the content-addressed store, hash-verified

137}
138
139function 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
146function addressToString(address) {
147 if (_.isPlainObject(address)) {

Callers 1

formatPayloadFunction · 0.85

Calls 1

addressToStringFunction · 0.85

Tested by

no test coverage detected