image only via attachment

This commit is contained in:
NikitaVashchuk 2023-05-03 16:58:54 +05:00
parent 5fcbee4662
commit 78c75d355d
2 changed files with 17 additions and 18 deletions

View File

@ -196,7 +196,14 @@ public class NotifyHelper
{
args.Add(new TagValue(CommonTags.VirtualRootPath, url));
args.Add(new TagValue(CommonTags.ProfileUrl, url + _commonLinkUtility.GetMyStaff()));
args.Add(new TagValue(CommonTags.LetterLogo, _tenantLogoManager.GetLogoDark(false)));
var attachment = _tenantLogoManager.GetMailLogoAsAttacment().Result;
if (attachment != null)
{
args.Add(new TagValue(CommonTags.LetterLogo, "cid:" + attachment.ContentId));
args.Add(new TagValue(CommonTags.EmbeddedAttachments, new[] { attachment }));
}
}
return args;

View File

@ -368,27 +368,19 @@ public class NotifyTransferRequest : INotifyEngineAction
private void AddLetterLogo(NotifyRequest request)
{
if (_tenantExtra.Enterprise || _coreBaseSettings.CustomMode)
try
{
try
{
var attachment = _tenantLogoManager.GetMailLogoAsAttacment().Result;
var attachment = _tenantLogoManager.GetMailLogoAsAttacment().Result;
if (attachment != null)
{
request.Arguments.Add(new TagValue(CommonTags.LetterLogo, "cid:" + attachment.ContentId));
request.Arguments.Add(new TagValue(CommonTags.EmbeddedAttachments, new[] { attachment }));
return;
}
}
catch (Exception error)
if (attachment != null)
{
_log.ErrorAddLetterLogo(error);
request.Arguments.Add(new TagValue(CommonTags.LetterLogo, "cid:" + attachment.ContentId));
request.Arguments.Add(new TagValue(CommonTags.EmbeddedAttachments, new[] { attachment }));
}
}
var logoUrl = _commonLinkUtility.GetFullAbsolutePath(_tenantLogoManager.GetLogoDark(false).Result);
request.Arguments.Add(new TagValue(CommonTags.LetterLogo, logoUrl));
catch (Exception error)
{
_log.ErrorAddLetterLogo(error);
}
}
}