mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-15 01:32:55 -07:00
Fixed #2636
This commit is contained in:
parent
62d8d5806f
commit
f048505eed
1 changed files with 13 additions and 1 deletions
|
@ -4,7 +4,9 @@ using EnsureThat;
|
|||
using MailKit.Net.Smtp;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MimeKit;
|
||||
using MimeKit.Utils;
|
||||
using Ombi.Core.Settings;
|
||||
using Ombi.Helpers;
|
||||
using Ombi.Notifications.Models;
|
||||
using Ombi.Notifications.Templates;
|
||||
using Ombi.Settings.Settings.Models;
|
||||
|
@ -36,6 +38,15 @@ namespace Ombi.Notifications
|
|||
|
||||
var customization = await CustomizationSettings.GetSettingsAsync();
|
||||
var html = email.LoadTemplate(model.Subject, model.Message, null, customization.Logo);
|
||||
|
||||
var messageId = MimeUtils.GenerateMessageId();
|
||||
if (customization.ApplicationUrl.HasValue())
|
||||
{
|
||||
if (Uri.TryCreate(customization.ApplicationUrl, UriKind.RelativeOrAbsolute, out var url))
|
||||
{
|
||||
messageId = MimeUtils.GenerateMessageId(url.IdnHost);
|
||||
}
|
||||
}
|
||||
|
||||
var textBody = string.Empty;
|
||||
|
||||
|
@ -49,7 +60,8 @@ namespace Ombi.Notifications
|
|||
var message = new MimeMessage
|
||||
{
|
||||
Body = body.ToMessageBody(),
|
||||
Subject = model.Subject
|
||||
Subject = model.Subject,
|
||||
MessageId = messageId
|
||||
};
|
||||
message.From.Add(new MailboxAddress(string.IsNullOrEmpty(settings.SenderName) ? settings.SenderAddress : settings.SenderName, settings.SenderAddress));
|
||||
message.To.Add(new MailboxAddress(model.To, model.To));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue