sendgrid-php icon indicating copy to clipboard operation
sendgrid-php copied to clipboard

CORS issue

Open andoitz opened this issue 10 months ago • 0 comments

Hi,

I have a report on https://support.sendgrid.com/hc/en-us/requests/19947750?page=1

I am using this php repository to send emails, it was working last month but now sendgid is returing code 202 with CORS issue:

X-No-CORS-Reason: https://sendgrid.com/docs/Classroom/Basics/API/cors.html

It sends an empty response with only that in the header.

Code is real simple and should work no matter what:

$sendgrid = new \SendGrid( \Config::get('app.sendgrid.apikey') );
$email = new \SendGrid\Mail\Mail();
$email->setFrom($this->from, $this->from_name);
$email->setReplyTo($this->reply_to);
$email->setTemplateId( new \SendGrid\Mail\TemplateId($template_id) );

$response = $sendgrid->send($email);

Can you please help me figure out why this happens?

andoitz avatar Feb 18 '25 14:02 andoitz