Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Batch Email ? #44

Open
shimsag opened this issue Mar 26, 2021 · 2 comments
Open

Support for Batch Email ? #44

shimsag opened this issue Mar 26, 2021 · 2 comments

Comments

@shimsag
Copy link

shimsag commented Mar 26, 2021

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 ?

@mfn
Copy link
Contributor

mfn commented Mar 26, 2021

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

🤷‍♀️

@shimsag
Copy link
Author

shimsag commented Mar 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants