我已配置SendGrid为平台发送电子邮件。尽管如此,邮件仍然试图使用DefaultSmtpEmailNotificationSendingGateway发送。
我在VirtoCommerce.Platform.Web项目StartUp.cs中找到了这段代码。
var emailNotificationSendingGatewayName = ConfigurationManager.AppSettings.GetValue("VirtoCommerce:Notifications:Gateway", "Default");
if (string.Equals(emailNotificationSendingGatewayName, "Default", StringComparison.OrdinalIgnoreCase))
{
emailNotificationSendingGateway = new DefaultSmtpEmailNotificationSendingGateway(settingsManager);
}
else if (string.Equals(emailNotificationSendingGatewayName, "SendGrid", StringComparison.OrdinalIgnoreCase))
{
emailNotificationSendingGateway = new SendGridEmailNotificationSendingGateway(settingsManager);
}
if (emailNotificationSendingGateway != null)
{
container.RegisterInstance(emailNotificationSendingGateway);
}
基于我的尝试。
尽管如此,邮件仍然在上述四个状态中路由到DefaultSmtpEmailNotificationSendingGateway。