ActiveCampaign / postmark-php

The official PHP library for Postmark.

Home Page:https://postmarkapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Optionally Accept Arrays for to/cc/bcc fields

SaintPeter opened this issue · comments

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:

  1. The current status quo: a string with a comma separated list of addresses
  2. A flat array of email addresses, IE:
$to = [ 'box@example.com', 'joe@example.com'];
  1. A nested array of display name/email pairs, IE:
$to = [ 
  [ 'Bob Jones', 'bob@example.com' ],
  [ 'Joe Bobson', 'joe@example.com' ]
];

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.

Thanks for the feedback. This is a behavior rather than a bug/issue. I am going to close this issue but please know I have taken this idea to the engineering team. Thanks.