postmark-php
postmark-php copied to clipboard
Feature Request: Optionally Accept Arrays for to/cc/bcc fields
I am in the process of converting my PHP backend from using SMPT mail to PostMark's API.
One key sticking point which is causing a lot of friction is that the to
, cc
, and bcc
fields only accept a string with comma separated email addresses. This is in contrast to the SMTP client I was using before (and several others I'm familiar with), as well as other APIs (notably SendInBlue's API).
I propose that every function/endpoint which has a to/cc/bcc field should accept one of the following:
- The current status quo: a string with a comma separated list of addresses
- A flat array of email addresses, IE:
$to = [ '[email protected]', '[email protected]'];
- A nested array of display name/email pairs, IE:
$to = [
[ 'Bob Jones', '[email protected]' ],
[ 'Joe Bobson', '[email protected]' ]
];
While this does add a bit of overhead to processing these addresses, it more closely aligns with the way multiple addresses are generally used in the real world.