Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MrMitch
Copy link

@MrMitch MrMitch commented May 7, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
Issues N/A
License MIT

This PR adds support for scheduling delivery when using the SendGrid API transport (with a sendgrid+api DSN), by providing a \DateTimeInterface object in a Symfony\Component\Mime\Header\DateHeader named Send-At.

$email = new \Symfony\Component\Mime\Email();
$email->getHeaders()->addDateHeader('Send-At', (new \DateTime())->modify('+3 hours'));

It will be mapped to the send_at parameter of the [POST] /mail/send API endpoint.

@carsonbot carsonbot added this to the 6.4 milestone May 7, 2025
@carsonbot carsonbot changed the title [Mailer][SendGrid] add support for scheduling delivery via send_at API parameter [Mailer] [SendGrid] add support for scheduling delivery via send_at API parameter May 7, 2025
@MrMitch
Copy link
Author

MrMitch commented May 7, 2025

Test failures look unrelated

@OskarStark OskarStark modified the milestones: 6.4, 7.3 May 7, 2025
@OskarStark
Copy link
Contributor

New features need to target the newest branch, which is 7.3

@OskarStark OskarStark changed the title [Mailer] [SendGrid] add support for scheduling delivery via send_at API parameter [Mailer][SendGrid] add support for scheduling delivery via send_at API parameter May 7, 2025
@carsonbot carsonbot changed the title [Mailer][SendGrid] add support for scheduling delivery via send_at API parameter [Mailer] [SendGrid] add support for scheduling delivery via send_at API parameter May 8, 2025
@MrMitch MrMitch force-pushed the sendgrid-mailer-date-send-at branch from 50ac018 to a317491 Compare May 8, 2025 10:39
@MrMitch MrMitch changed the base branch from 6.4 to 7.3 May 8, 2025 10:39
@MrMitch
Copy link
Author

MrMitch commented May 8, 2025

@OskarStark @bkosun Thank you for your feedback, I've applied all the suggested changes. Let me know if you would like me to make additional changes.

@stof
Copy link
Member

stof commented May 16, 2025

Is this Send-At header supported by their SMTP server ?

@MrMitch
Copy link
Author

MrMitch commented May 16, 2025

Hi @stof,

Yes, the Send-At header is supported by their SMTP server as well, as per the documentation :

You can use the SMTP API header to schedule your emails when sending via SMTP or our mail.send API endpoint.

@OskarStark OskarStark changed the title [Mailer] [SendGrid] add support for scheduling delivery via send_at API parameter [Mailer][SendGrid] add support for scheduling delivery via send_at API parameter May 16, 2025
@fabpot fabpot removed this from the 7.3 milestone May 26, 2025
@fabpot fabpot added this to the 7.4 milestone May 26, 2025
@nicolas-grekas nicolas-grekas force-pushed the sendgrid-mailer-date-send-at branch from a317491 to 74616f1 Compare November 14, 2025 14:06
@MrMitch
Copy link
Author

MrMitch commented Nov 14, 2025

Test failures look unrelated, they all reference Symfony\Bundle\FrameworkBundle\Tests\Command\SecretsListCommandTest::testExecute which is outside the scope of this PR

@nicolas-grekas nicolas-grekas modified the milestones: 7.4, 8.1 Nov 16, 2025
@fabpot fabpot force-pushed the sendgrid-mailer-date-send-at branch from a501f19 to 87f5f97 Compare November 20, 2025 07:16
@fabpot
Copy link
Member

fabpot commented Nov 20, 2025

Thank you @MrMitch.

@fabpot fabpot merged commit 24f8e13 into symfony:8.1 Nov 20, 2025
9 of 10 checks passed
@MrMitch MrMitch deleted the sendgrid-mailer-date-send-at branch November 20, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants