php-aws-ses icon indicating copy to clipboard operation
php-aws-ses copied to clipboard

How to use the library to send bulk emails?

Open DevKishan opened this issue 5 years ago • 7 comments

I need to send bulk emails to multiple recipients using Amazon SES. Also, each email should be personalized according to the recipient's data. e.g. In the email content and the subject, {{Name}} placeholder tag should be replaced with provided recipient data for each recipient.

Is it possible with this library?

DevKishan avatar Apr 08 '21 06:04 DevKishan

You'll need to send every single personalised email with this library

daniel-zahariev avatar Apr 08 '21 06:04 daniel-zahariev

Thanks for your prompt response. Is there any custom code available that can be added to the library to use it for bulk sending?

DevKishan avatar Apr 08 '21 07:04 DevKishan

The library's main purpose is to send emails and in the latest versions the bulk sending mode is enabled by default. What more do you need?

daniel-zahariev avatar Apr 08 '21 07:04 daniel-zahariev

Currently, I need to send personalized emails in batches

i.e. if there are 5000 emails that have to be sent, then break them into 5 batches each containing 1000 emails.

Prepare some personalization data(name, age, etc) for each email recipient in a batch and then send all emails in the batch along with personalization data of recipients to Amazon SES API in one API request only. This would repeat for each batch then until all batches are processed.

Will that be possible with the library?

DevKishan avatar Apr 08 '21 08:04 DevKishan

You're looking in the wrong place. As far as I know this is not possible with Amazon SES. With SES you'll have to send the email body (text/html) to the API for every single recipient. No way to use a template and send parameters for every recipient.

daniel-zahariev avatar Apr 08 '21 10:04 daniel-zahariev

@daniel-zahariev I think @DevKishan is looking for this API sendBulkTemplatedEmail https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-email-2010-12-01.html#sendbulktemplatedemail

rambhosale avatar Aug 14 '21 03:08 rambhosale

See also: https://docs.aws.amazon.com/ses/latest/dg/send-personalized-email-api.html

tobwen avatar Feb 15 '22 21:02 tobwen