committed by
GitHub
5 changed files with 72 additions and 2 deletions
@ -0,0 +1,34 @@ |
|||||
|
using LINGYUN.Abp.BackgroundTasks.Localization; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.TextTemplating; |
||||
|
|
||||
|
namespace LINGYUN.Abp.BackgroundTasks.Notifications.Templates; |
||||
|
public class BackgroundTasksNotificationTemplateDefinitionProvider : TemplateDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(ITemplateDefinitionContext context) |
||||
|
{ |
||||
|
context.Add(GetTemplateDefinitions()); |
||||
|
} |
||||
|
|
||||
|
private static TemplateDefinition[] GetTemplateDefinitions() |
||||
|
{ |
||||
|
return new[] |
||||
|
{ |
||||
|
new TemplateDefinition( |
||||
|
BackgroundTasksNotificationTemplates.JobExecutedNotification, |
||||
|
displayName: L("TextTemplate:JobExecutedNotification"), |
||||
|
localizationResource: typeof(BackgroundTasksResource) |
||||
|
).WithVirtualFilePath( |
||||
|
"/LINGYUN/Abp/BackgroundTasks/Notifications/Templates/JobExecutedNotification.tpl", |
||||
|
isInlineLocalized: true) |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
private static ILocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<BackgroundTasksResource>(name); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace LINGYUN.Abp.BackgroundTasks.Notifications.Templates; |
||||
|
|
||||
|
public static class BackgroundTasksNotificationTemplates |
||||
|
{ |
||||
|
public const string JobExecutedNotification = "Abp.BackgroundTasks.JobExecutedNotification"; |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
### <font color="{{ model.color }}" size=3>{{ model.title }}</font> |
||||
|
--- |
||||
|
{{ if model.tenantname }} |
||||
|
* **{{ L "TenantName"}}**: {{ model.tenantname }} |
||||
|
{{ end }} |
||||
|
* **{{ L "JobGroup"}}**: {{ model.group }} |
||||
|
* **{{ L "JobName"}}**: {{ model.name }} |
||||
|
* **{{ L "JobId"}}**: {{ model.id }} |
||||
|
* **{{ L "JobType"}}**: {{ model.type }} |
||||
|
* **{{ L "TriggerTime"}}**: <font color="#1E90FF ">{{ model.triggertime }}</font> |
||||
|
--- |
||||
|
{{ if model.error }} |
||||
|
{{ model.errormessage }} |
||||
|
{{ end }} |
||||
Loading…
Reference in new issue