postalserver / postal

📮 A fully featured open source mail delivery platform for incoming & outgoing e-mail
https://postalserver.io
MIT License
14.85k stars 1.05k forks source link

Bulk sending messages in single API call #183

Open adamcooke opened 7 years ago

adamcooke commented 7 years ago

It would be good to send multiple messages to the API in a single HTTP request. The current send/message and send/raw methods are designed for sending a single method.

A new method (or methods) will be needed for this purpose.

In theory, the API should simply accept an array of hashes containing the params that would normally be passed to the send/message or send/raw methods. It should then go through this array and compile a result hash that is the same format of that in the single messages above.

alexroosenstein commented 7 years ago

Could the code I submitted be used as basis, removing the to parameter, and give it a different API endpoint?

In my opinion it should be possible to define global parameters (e.g. subject, from, html body), which can be appended/overwritten with per-recipient parameters.