vemcogroup / laravel-sparkpost-driver

SparkPost driver to use with Laravel
MIT License
40 stars 16 forks source link

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

Open balakrishnan178 opened 6 months ago

balakrishnan178 commented 6 months ago

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

danijelk commented 6 months ago

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?

balakrishnan178 commented 6 months ago

Yes sir. we did that.

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