如何解决没有收到通过 sendgrid 发送的邮件
我正在使用 sendgrid api 密钥向用户发送邮件。 我正在邮件中附上日历以邀请人们。当我使用亚洲/东京时区和美国/温哥华时区时,人们收到了邀请。
以下是日历构建器代码
if (emailType?.equalsIgnoreCase(AppConstant.EMAIL_TYPE_CONFIRM)) {
builder.calendar() {
events {
event(
start: Date.parse('yyyy-MM-dd HH:mm',icsstartDateTime),end: Date.parse('yyyy-MM-dd HH:mm',icsEndDateTime),summary: summary,timezone: appointmentDetails.timeZone,location: appointmentDetails.venue
) {
reminder(minutesBefore: 30,description: summary)
}
}
}
} else if (emailType.equalsIgnoreCase(AppConstant.EMAIL_TYPE_CANCEL) && (attachment != null)) {
builder.calendar(method: 'CANCEL') {
events {
event(
start: Date.parse('yyyy-MM-dd HH:mm',sequence: 12,//It is a random number; should be greater than the sequence in the ICS file selected for cancellation
uid: UID,location: appointmentDetails.venue,method: 'CANCEL',status: 'CANCELLED'
)
}
现在当我使用 America/Chicago 作为时区时,我在控制台中收到 202 响应代码。
Request request = new Request()
request.with {
method = Method.POST
endpoint = "mail/send"
body = mail.build() }
Response response = sg.api(request)
System.out.println(response.getStatusCode());
可能的原因是什么?
谢谢
苏汉姆
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。