This commit is contained in:
2022-03-07 20:52:58 +00:00
parent b4f5ef3a72
commit d51dd84b29
2 changed files with 6 additions and 28 deletions

View File

@@ -1302,7 +1302,8 @@ namespace AyaNova.Biz
ObjectId = oProposed.QuoteId,
CustomerNotifySubscriptionId = sub.Id,
Name = $"{QuoteInfo.Serial.ToString()} - {qos.Name}",
Message=//TODO: template processing here
Subject="TEST SUBJECT",
Message="TEST MESSAGE"//TODO: template processing here
};
await ct.CustomerNotifyEvent.AddAsync(n);
log.LogDebug($"Adding CustomerNotifyEvent: [{n.ToString()}]");

View File

@@ -406,37 +406,14 @@ namespace AyaNova.Biz
{
string subject = "";
string subject = ne.Subject;
IMailer m = AyaNova.Util.ServiceProviderProvider.Mailer;
var body = "";
var body = ne.Message;
//Special notification handling
switch (ne.EventType)
{
case NotifyEventType.CustomerServiceImminent:
subject = subscription.;
body = LT["NotifyEventCustomerServiceImminentMessage"].Replace("{0}", AyaNova.Util.DateUtil.FormatTimeSpan(advanceNotice, LT["TimeSpanDays"], LT["TimeSpanHours"], LT["TimeSpanMinutes"], LT["TimeSpanSeconds"]));
body += $"\n{OpenObjectUrlBuilder(ne.AyaType, ne.ObjectId, ne.EventType)}\n";
break;
default:
subject = $"AY:{AyaTypeTranslated}:{name}:{SubscriptionTypeName}";
if (ne.ObjectId != 0 || ne.EventType == NotifyEventType.BackupStatus)
{
body = $"{AgeDisplay}{DecDisplay}{AyaTypeTranslated}\n{OpenObjectUrlBuilder(ne.AyaType, ne.ObjectId, ne.EventType)}\n";
}
body += ne.Message;
break;
}
//Add link to subscription, all messages have this regardless of content
//http://localhost:8080/open/51/1 //add subscription link, notifysub is object type 51
if (!body.EndsWith('\n'))
body += "\n";
body += $"-----\n{NotifySubscriptionLinkText}\n{OpenSubscriptionUrlBuilder(ne.CustomerNotifySubscriptionId)}\n";
if (!ServerGlobalOpsSettingsCache.Notify.SmtpDeliveryActive)
{