swiftmailer-postmark icon indicating copy to clipboard operation
swiftmailer-postmark copied to clipboard

Support for Batch Email ?

Open shimsag opened this issue 3 years ago • 2 comments

I am using this package with Laravel 8 application, and would like to integrate Batch email sending. Are there plans to add Batch sending soon ?

shimsag avatar Mar 26 '21 12:03 shimsag

Does swiftmailer support it?

I couldn't find anything in https://swiftmailer.symfony.com/docs/sending.html (the batch example there is still about sending individual messages).

I also see nothing on the interface giving a sense it's possible, there's only send() for single messages too on the transport: https://github.com/swiftmailer/swiftmailer/blob/27d5ef808a066747d60f5329985949a559ec35a0/lib/classes/Swift/Transport.php#L70

🤷‍♀️

mfn avatar Mar 26 '21 19:03 mfn

Does swiftmailer support it?

I couldn't find anything in https://swiftmailer.symfony.com/docs/sending.html (the batch example there is still about sending individual messages).

I also see nothing on the interface giving a sense it's possible, there's only send() for single messages too on the transport: https://github.com/swiftmailer/swiftmailer/blob/27d5ef808a066747d60f5329985949a559ec35a0/lib/classes/Swift/Transport.php#L70

🤷‍♀️

You're right they don't... But I have an idea of a way to make it happen.

		if(!empty($serverToken['token'])){
			$this->serverToken = $serverToken['token'];
		}else{
			$this->serverToken = $serverToken;
		}

This way I'm passing thru an array with Sever Token and Boolean to indicate whether it's batch sending or not.

After that, I will wrap the below json array in Transport File with IF statement and foreach loop (for each email address). 'json' => $this->getMessagePayload($message),

I would appreciate your comments about this idea.

shimsag avatar Mar 26 '21 20:03 shimsag