When using the same email in $to param in \SendGrid\Mail::__construct and SendGrid\Personalization::addTo() the send grid count the sent email twice instead of counting it one time
#### Steps to Reproduce\
When you try add cc or bcc using new pesrsonalization
$personalization = new \SendGrid\Personalization();
$to = new \SendGrid\Email("", '[email protected]');
$email = new \SendGrid\Mail(
$from
, $subject
, $to
, new SendGrid\Content("text/html", $body));
$personalization->addBcc(new SendGrid\Email("", $bcc));
$email->addPersonalization($personalization);
$sendgrid = new \SendGrid($key)
$response = $sendgrid->client->mail()->send()->post($email);
Same happening for me but different usage so will post new issue.
Hi @elshafey,
Could you please print out your request body so I can try and reproduce?
@CostaC,
Please reference this issue in your new issue.
Thanks!
With Best Regards,
Elmer
It happens the same to me as well. However checking out the request body, I got to know that I add $to twice like the below.
first one.
$mail = new SendGrid\Mail($from, $subject, $to, $content);
and second one.
$personalization = new SendGrid\Personalization();
$personalization->addTo($to);
It sends twice because I added twice.
Please check if yours works as like mine does.
Thanks for providing some additional feedback @kabkee!
Most helpful comment
It happens the same to me as well. However checking out the request body, I got to know that I add $to twice like the below.
first one.
$mail = new SendGrid\Mail($from, $subject, $to, $content);and second one.
$personalization = new SendGrid\Personalization();$personalization->addTo($to);It sends twice because I added twice.
Please check if yours works as like mine does.