diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplateDefinitionProvider.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplateDefinitionProvider.cs new file mode 100644 index 000000000..350a4b5d1 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplateDefinitionProvider.cs @@ -0,0 +1,33 @@ +using LINGYUN.Abp.BackgroundTasks.Localization; +using Volo.Abp.Localization; +using Volo.Abp.TextTemplating; + +namespace LINGYUN.Abp.BackgroundTasks.ExceptionHandling.Templates +{ + public class JobExceptionHandlingTemplateDefinitionProvider : TemplateDefinitionProvider + { + public override void Define(ITemplateDefinitionContext context) + { + context.Add(GetTemplateDefinitions()); + } + + private static TemplateDefinition[] GetTemplateDefinitions() + { + return new[] + { + new TemplateDefinition( + JobExceptionHandlingTemplates.JobExceptionNotifier, + displayName: L("TextTemplate:JobExceptionNotifier"), + localizationResource: typeof(BackgroundTasksResource) + ).WithVirtualFilePath( + "/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl", + isInlineLocalized: true) + }; + } + + private static ILocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplates.cs b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplates.cs new file mode 100644 index 000000000..e84c51984 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionHandlingTemplates.cs @@ -0,0 +1,7 @@ +namespace LINGYUN.Abp.BackgroundTasks.ExceptionHandling.Templates +{ + public class JobExceptionHandlingTemplates + { + public const string JobExceptionNotifier = "Abp.BackgroundTasks.JobExceptionNotifier"; + } +} diff --git a/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl new file mode 100644 index 000000000..e840f3039 --- /dev/null +++ b/aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.ExceptionHandling/LINGYUN/Abp/BackgroundTasks/ExceptionHandling/Templates/JobExceptionNotifier.tpl @@ -0,0 +1,51 @@ + + + + + {{ model.title }} + + + + + + + + + + + + + + + + + + +
+
+ {{ L "JobExecuteError" }} +
+
+
    + {{ 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" }} : {{ model.triggertime }}
  • +
+
+ {{ L "ErrorMessage" }} +
+
+
{{ model.message }}
+
+
+
+ {{ model.footer }} +
+
+ + \ No newline at end of file