我在我的控制台应用程序中使用AWS Pinpoint。我可以通过它发送SimpleEmail。就像这样:
var sendRequest = new SendMessagesRequest
{
ApplicationId = appId,
MessageRequest = new MessageRequest
{
Addresses = new Dictionary<string, AddressConfiguration>
{
{
demomail,
new AddressConfiguration
{
ChannelType=ChannelType.EMAIL
}
}
},
MessageConfiguration = new DirectMessageConfiguration
{
EmailMessage = new EmailMessage
{
SimpleEmail = new SimpleEmail
{
HtmlPart = new SimpleEmailPart
{
Charset = "UTF-8",
Data = @"<html><head></head><body><h1>Amazon Pinpoint Email Test (AWS SDK for .NET)</h1></body></html>"
},
TextPart = new SimpleEmailPart
{
Charset = "UTF-8",
Data = @"This email was sent using the Amazon Pinpoint API using the AWS SDK for .NET."
},
Subject = new SimpleEmailPart
{
Charset = "UTF-8",
Data = @"Test Mail"
}
}
}
}
}
};
但是我想在我的电子邮件中包含附件,为此我需要使用RawEmail。但我找不到适当的文件发送电子邮件与pdf附件。谁能告诉我或帮助我。
2条答案
按热度按时间nwlls2ji1#
Pinpoint不支持附件。对于类似的用例,我们复制了附件AWS S3,并在电子邮件中共享了下载附件的链接。
yqkkidmi2#
您还可以使用Amazon Pinpoint Campaign中的自定义频道来调用Lambda函数,该函数可以使用原始电子邮件函数在电子邮件中发送pdf附件。下面是一个示例代码: