问题描述
我使用的是 SAAS 系统,该系统同时发送营销和交易电子邮件。我最近将 AWS SDK 更新到 V2。这样做之后,我遇到了一些问题。问题之一是,在交易电子邮件中,我无法像营销电子邮件一样在链接中看到跟踪信息。
https://example.com/review/637224/mBS91knZyHyaIK0WYVjS
正如您在上面看到的,在第一个链接中,我可以看到电子邮件是从哪个区域发送的以及 ses 消息 ID 是什么。但在第二个链接中只显示普通链接。
这两种情况的 ses 输入是:
营销:
input := &sesv2.SendEmailInput{
Destination: &types.Destination{
CcAddresses: []string{},ToAddresses: []string{request.EmailTo},},Content: &types.EmailContent{
Simple: &types.Message{
Body: &types.Body{
Html: &types.Content{
Charset: aws.String("UTF-8"),Data: aws.String(emailData["body"]),Subject: &types.Content{
Charset: aws.String("UTF-8"),Data: aws.String(emailData["subject"]),ReplyToAddresses: []string{emailData["sender_name"] + " <" + replyTo + ">"},FromEmailAddress: aws.String(emailData["sender_name"] + " <" + emailData["sender_email"] + ">"),}
input.ConfigurationSetName = aws.String(config.EmailTrackingConfigSetName)
cfg,err := awsconfig.LoadDefaultConfig(context.Todo(),awsconfig.WithRegion(bkconfig.CampaignEmailAwsRegion),)
client := sesv2.NewFromConfig(cfg)
emailResp,err := client.SendEmail(context.Todo(),input)
交易:
CharSet := "UTF-8"
input := &sesv2.SendEmailInput{
Destination: &types.Destination{
CcAddresses: []string{},Content: &types.EmailContent{
Simple: &types.Message{
Body: &types.Body{
Html: &types.Content{
Charset: aws.String(CharSet),Data: aws.String(body),Subject: &types.Content{
Charset: aws.String(CharSet),Data: aws.String(subject),ReplyToAddresses: []string{"\"" + storeDetails["email_display_name"] + "\" <" + replyTo + ">"},FromEmailAddress: aws.String("\"" + storeDetails["email_display_name"] + "\" <" + storeDetails["sender_email"] + ">"),}
input.ConfigurationSetName = aws.String(config.EmailTrackingConfigSetName)
/* Attempt to send the email */
cfg,awsconfig.WithRegion(config.AwsRegion),input)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)