laravel-sparkpost-driver icon indicating copy to clipboard operation
laravel-sparkpost-driver copied to clipboard

If we give the same email in TO, we are getting duplicate emails

Open balakrishnan178 opened this issue 11 months ago • 2 comments

If we give the same email in TO, we are getting duplicate emails. but it is working fine in the older version (4.0.4).

We analysed your code and found the reason.

Previously we used the switch message "getTo" function. So that function handled duplicate emails. Please see the below screenshots https://prnt.sc/y03OuEG64wBU https://prnt.sc/ccKrF6fHQV1O

Now we are using our own "getTo" function. we didn't remove duplicate emails https://prnt.sc/6G3ZUophwTcn https://prnt.sc/YwRHZ8P-4B7E

So kindly fix this issue in an upcoming version. Thank you

balakrishnan178 avatar Mar 07 '24 04:03 balakrishnan178

Hi,

we could filter the to addresses to remove duplicates I guess, but if you want a quick fix why not just array_unique your emails before feeding them into the ->to() method?

danijelk avatar Mar 07 '24 11:03 danijelk

Yes sir. we did that.

But if bcc or cc have the same emails which present in "to" list. we are facing issue

balakrishnan178 avatar Mar 07 '24 11:03 balakrishnan178