简体   繁体   中英

Is it necessary to set timezone to a local area when using SendGrid API?

If use SendGrid's send_at API in Japan:

https://docs.sendgrid.com/for-developers/sending-email/scheduling-parameters#example-of-send_at-email-header

Set an UTC value to it and post the API to schedule when the mail will be sent.

On the SendGrid's dashboard, is it necessary to change the default timezone to Japan(Asia/Tokyo) to ensure the mail send on Japanese time?

But for other countries, if release the application service to another country with different timezone, how to make sure the mail will be sent correctly for people in two countries?

send_at is a Unix timestamp . Unix timestamps are always in terms of UTC . UTC is the same value simultaneously for everyone on the pl.net - it does not involve time zones. Whatever UTC timestamp you send to SendGrid, that's the exact time the mail will be scheduled to be sent.

If you are deriving that value from a local time, then you will need to take the time zone into account when you convert from local time to UTC. How you do that is very specific to your own application logic and choice of programming language and platform.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM