diff --git a/EventHub.sln b/EventHub.sln index 08bd58a..d1cce1d 100644 --- a/EventHub.sln +++ b/EventHub.sln @@ -41,6 +41,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Web.Admin", "src\E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventHub.Web", "src\EventHub.Web\EventHub.Web.csproj", "{19F3FAD2-740F-4933-A394-4B030E2ABE6A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventHub.BackgroundServices", "src\EventHub.BackgroundServices\EventHub.BackgroundServices.csproj", "{7A16923F-06FA-40B4-8A54-69E7828B1D69}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -115,6 +117,10 @@ Global {19F3FAD2-740F-4933-A394-4B030E2ABE6A}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F3FAD2-740F-4933-A394-4B030E2ABE6A}.Release|Any CPU.ActiveCfg = Release|Any CPU {19F3FAD2-740F-4933-A394-4B030E2ABE6A}.Release|Any CPU.Build.0 = Release|Any CPU + {7A16923F-06FA-40B4-8A54-69E7828B1D69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A16923F-06FA-40B4-8A54-69E7828B1D69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A16923F-06FA-40B4-8A54-69E7828B1D69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A16923F-06FA-40B4-8A54-69E7828B1D69}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -137,6 +143,7 @@ Global {AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} {27B2DDC7-8B75-4322-A312-25419C15D9D8} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} {19F3FAD2-740F-4933-A394-4B030E2ABE6A} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} + {7A16923F-06FA-40B4-8A54-69E7828B1D69} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6AAFA1C6-603E-13FA-45E5-7910AA9F661D} diff --git a/src/EventHub.Application/EventHub.Application.csproj b/src/EventHub.Application/EventHub.Application.csproj index 6a63ad0..cfdfd9f 100644 --- a/src/EventHub.Application/EventHub.Application.csproj +++ b/src/EventHub.Application/EventHub.Application.csproj @@ -18,9 +18,4 @@ - - - - - diff --git a/src/EventHub.Application/EventHubApplicationModule.cs b/src/EventHub.Application/EventHubApplicationModule.cs index f0ea9e9..56d09b5 100644 --- a/src/EventHub.Application/EventHubApplicationModule.cs +++ b/src/EventHub.Application/EventHubApplicationModule.cs @@ -1,12 +1,8 @@ -using EventHub.Events; -using Volo.Abp; -using Volo.Abp.Account; +using Volo.Abp.Account; using Volo.Abp.AutoMapper; -using Volo.Abp.BackgroundWorkers; using Volo.Abp.Identity; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; -using Volo.Abp.VirtualFileSystem; namespace EventHub { @@ -15,29 +11,16 @@ namespace EventHub typeof(AbpAccountApplicationModule), typeof(EventHubApplicationContractsModule), typeof(AbpIdentityApplicationModule), - typeof(AbpPermissionManagementApplicationModule), - typeof(AbpBackgroundWorkersModule) - )] + typeof(AbpPermissionManagementApplicationModule) + )] public class EventHubApplicationModule : AbpModule { - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - context.AddBackgroundWorker(); - context.AddBackgroundWorker(); - context.AddBackgroundWorker(); - } - public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => { options.AddMaps(); }); - - Configure(options => - { - options.FileSets.AddEmbedded("EventHub"); - }); } } } diff --git a/src/EventHub.BackgroundServices/EventHub.BackgroundServices.csproj b/src/EventHub.BackgroundServices/EventHub.BackgroundServices.csproj new file mode 100644 index 0000000..5793ab8 --- /dev/null +++ b/src/EventHub.BackgroundServices/EventHub.BackgroundServices.csproj @@ -0,0 +1,34 @@ + + + + + + Exe + net5.0 + EventHub + + + + + + + + + + + + + + + + + + PreserveNewest + Always + + + + + + + diff --git a/src/EventHub.BackgroundServices/EventHubBackgroundServicesHostedService.cs b/src/EventHub.BackgroundServices/EventHubBackgroundServicesHostedService.cs new file mode 100644 index 0000000..4bd8e23 --- /dev/null +++ b/src/EventHub.BackgroundServices/EventHubBackgroundServicesHostedService.cs @@ -0,0 +1,36 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; +using Volo.Abp; + +namespace EventHub +{ + public class EventHubBackgroundServicesHostedService : IHostedService + { + private readonly IAbpApplicationWithExternalServiceProvider _application; + private readonly IServiceProvider _serviceProvider; + + public EventHubBackgroundServicesHostedService( + IAbpApplicationWithExternalServiceProvider application, + IServiceProvider serviceProvider) + { + _application = application; + _serviceProvider = serviceProvider; + } + + public Task StartAsync(CancellationToken cancellationToken) + { + _application.Initialize(_serviceProvider); + + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + _application.Shutdown(); + + return Task.CompletedTask; + } + } +} diff --git a/src/EventHub.BackgroundServices/EventHubBackgroundServicesModule.cs b/src/EventHub.BackgroundServices/EventHubBackgroundServicesModule.cs new file mode 100644 index 0000000..6804a1f --- /dev/null +++ b/src/EventHub.BackgroundServices/EventHubBackgroundServicesModule.cs @@ -0,0 +1,32 @@ +using EventHub.Events; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Volo.Abp; +using Volo.Abp.Autofac; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Modularity; + +namespace EventHub +{ + + [DependsOn( + typeof(AbpAutofacModule) + )] + public class EventHubBackgroundServicesModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var hostEnvironment = context.Services.GetSingletonInstance(); + + context.Services.AddHostedService(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + context.AddBackgroundWorker(); + context.AddBackgroundWorker(); + context.AddBackgroundWorker(); + } + } +} diff --git a/src/EventHub.Application/Events/EventReminderNotifier.cs b/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs similarity index 100% rename from src/EventHub.Application/Events/EventReminderNotifier.cs rename to src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs diff --git a/src/EventHub.Application/Events/EventReminderWorker.cs b/src/EventHub.BackgroundServices/Events/EventReminderWorker.cs similarity index 100% rename from src/EventHub.Application/Events/EventReminderWorker.cs rename to src/EventHub.BackgroundServices/Events/EventReminderWorker.cs diff --git a/src/EventHub.Application/Events/EventTimingChangeNotifier.cs b/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs similarity index 96% rename from src/EventHub.Application/Events/EventTimingChangeNotifier.cs rename to src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs index 2d27aee..7005133 100644 --- a/src/EventHub.Application/Events/EventTimingChangeNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs @@ -1,82 +1,81 @@ -using System; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Threading.Tasks; -using EventHub.Emailing; -using EventHub.Events.Registrations; -using EventHub.Users; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Emailing; -using Volo.Abp.Linq; -using Volo.Abp.TextTemplating; - -namespace EventHub.Events -{ - public class EventTimingChangeNotifier : ITransientDependency - { - private readonly IEmailSender _emailSender; - private readonly ITemplateRenderer _templateRenderer; - private readonly IRepository _eventRegistrationRepository; - private readonly IAsyncQueryableExecuter _asyncExecuter; - private readonly IRepository _userRepository; - - public EventTimingChangeNotifier( - IEmailSender emailSender, - ITemplateRenderer templateRenderer, - IRepository eventRegistrationRepository, - IAsyncQueryableExecuter asyncExecuter, - IRepository userRepository - ) - { - _emailSender = emailSender; - _templateRenderer = templateRenderer; - _eventRegistrationRepository = eventRegistrationRepository; - _asyncExecuter = asyncExecuter; - _userRepository = userRepository; - } - - public async Task NotifyAsync(Event @event) - { - if (@event is null) - { - return; - } - - var eventRegistrationQueryable = await _eventRegistrationRepository.GetQueryableAsync(); - var query = eventRegistrationQueryable - .Where(x => x.EventId == @event.Id && !x.IsTimingChangeEmailSent); - - var eventRegistrations = await _asyncExecuter.ToListAsync(query); - - foreach (var eventRegistration in eventRegistrations) - { - var user = await _userRepository.FindAsync(eventRegistration.UserId); - - if (user is null) - { - continue; - } - - var model = new - { - UserName = user.GetFullNameOrUsername(), - Title = @event.Title, - StartTime = @event.StartTime, - EndTime = @event.EndTime, - Url = @event.Url - }; - - await _emailSender.QueueAsync( - user.Email, - "Event time has been changed!", - await _templateRenderer.RenderAsync(EmailTemplates.EventTimingChanged, model) - ); - - eventRegistration.IsTimingChangeEmailSent = true; - } - - await _eventRegistrationRepository.UpdateManyAsync(eventRegistrations, autoSave: true); - } - } +using System; +using System.Linq; +using System.Threading.Tasks; +using EventHub.Emailing; +using EventHub.Events.Registrations; +using EventHub.Users; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Emailing; +using Volo.Abp.Linq; +using Volo.Abp.TextTemplating; + +namespace EventHub.Events +{ + public class EventTimingChangeNotifier : ITransientDependency + { + private readonly IEmailSender _emailSender; + private readonly ITemplateRenderer _templateRenderer; + private readonly IRepository _eventRegistrationRepository; + private readonly IAsyncQueryableExecuter _asyncExecuter; + private readonly IRepository _userRepository; + + public EventTimingChangeNotifier( + IEmailSender emailSender, + ITemplateRenderer templateRenderer, + IRepository eventRegistrationRepository, + IAsyncQueryableExecuter asyncExecuter, + IRepository userRepository + ) + { + _emailSender = emailSender; + _templateRenderer = templateRenderer; + _eventRegistrationRepository = eventRegistrationRepository; + _asyncExecuter = asyncExecuter; + _userRepository = userRepository; + } + + public async Task NotifyAsync(Event @event) + { + if (@event is null) + { + return; + } + + var eventRegistrationQueryable = await _eventRegistrationRepository.GetQueryableAsync(); + var query = eventRegistrationQueryable + .Where(x => x.EventId == @event.Id && !x.IsTimingChangeEmailSent); + + var eventRegistrations = await _asyncExecuter.ToListAsync(query); + + foreach (var eventRegistration in eventRegistrations) + { + var user = await _userRepository.FindAsync(eventRegistration.UserId); + + if (user is null) + { + continue; + } + + var model = new + { + UserName = user.GetFullNameOrUsername(), + Title = @event.Title, + StartTime = @event.StartTime, + EndTime = @event.EndTime, + Url = @event.Url + }; + + await _emailSender.QueueAsync( + user.Email, + "Event time has been changed!", + await _templateRenderer.RenderAsync(EmailTemplates.EventTimingChanged, model) + ); + + eventRegistration.IsTimingChangeEmailSent = true; + } + + await _eventRegistrationRepository.UpdateManyAsync(eventRegistrations, autoSave: true); + } + } } \ No newline at end of file diff --git a/src/EventHub.Application/Events/EventTimingChangeWorker.cs b/src/EventHub.BackgroundServices/Events/EventTimingChangeWorker.cs similarity index 97% rename from src/EventHub.Application/Events/EventTimingChangeWorker.cs rename to src/EventHub.BackgroundServices/Events/EventTimingChangeWorker.cs index 432a42d..c89ffcd 100644 --- a/src/EventHub.Application/Events/EventTimingChangeWorker.cs +++ b/src/EventHub.BackgroundServices/Events/EventTimingChangeWorker.cs @@ -1,51 +1,51 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using EventHub.Events.Registrations; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Volo.Abp.BackgroundWorkers; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Linq; -using Volo.Abp.Threading; -using Volo.Abp.Uow; - -namespace EventHub.Events -{ - public class EventTimingChangeWorker : AsyncPeriodicBackgroundWorkerBase - { - public EventTimingChangeWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) - { - Timer.Period = 60000; //1 minute - } - - [UnitOfWork(isTransactional: false)] - protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) - { - var eventTimingChangeNotifier = workerContext.ServiceProvider.GetRequiredService(); - var eventRepository = workerContext.ServiceProvider.GetRequiredService>(); - var eventRegistrationRepository = workerContext.ServiceProvider.GetRequiredService>(); - var asyncExecuter = workerContext.ServiceProvider.GetRequiredService(); - - var eventRegistrationQueryable = await eventRegistrationRepository.GetQueryableAsync(); - var query = eventRegistrationQueryable - .Where(x => !x.IsTimingChangeEmailSent) - .Select(x => x.EventId) - .Distinct(); - - var eventRegistrations = await asyncExecuter.ToListAsync(query); - - foreach (var eventRegistration in eventRegistrations) - { - try - { - await eventTimingChangeNotifier.NotifyAsync(await eventRepository.FindAsync(eventRegistration)); - } - catch (Exception e) - { - Logger.LogError($"An error occurred while sending an email to the attendees of the event after the event time has changed. Error message: {e.Message}"); - } - } - } - } +using System; +using System.Linq; +using System.Threading.Tasks; +using EventHub.Events.Registrations; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Volo.Abp.BackgroundWorkers; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Linq; +using Volo.Abp.Threading; +using Volo.Abp.Uow; + +namespace EventHub.Events +{ + public class EventTimingChangeWorker : AsyncPeriodicBackgroundWorkerBase + { + public EventTimingChangeWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) : base(timer, serviceScopeFactory) + { + Timer.Period = 60000; //1 minute + } + + [UnitOfWork(isTransactional: false)] + protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) + { + var eventTimingChangeNotifier = workerContext.ServiceProvider.GetRequiredService(); + var eventRepository = workerContext.ServiceProvider.GetRequiredService>(); + var eventRegistrationRepository = workerContext.ServiceProvider.GetRequiredService>(); + var asyncExecuter = workerContext.ServiceProvider.GetRequiredService(); + + var eventRegistrationQueryable = await eventRegistrationRepository.GetQueryableAsync(); + var query = eventRegistrationQueryable + .Where(x => !x.IsTimingChangeEmailSent) + .Select(x => x.EventId) + .Distinct(); + + var eventRegistrations = await asyncExecuter.ToListAsync(query); + + foreach (var eventRegistration in eventRegistrations) + { + try + { + await eventTimingChangeNotifier.NotifyAsync(await eventRepository.FindAsync(eventRegistration)); + } + catch (Exception e) + { + Logger.LogError($"An error occurred while sending an email to the attendees of the event after the event time has changed. Error message: {e.Message}"); + } + } + } + } } \ No newline at end of file diff --git a/src/EventHub.Application/Events/NewEventDetectorWorker.cs b/src/EventHub.BackgroundServices/Events/NewEventDetectorWorker.cs similarity index 64% rename from src/EventHub.Application/Events/NewEventDetectorWorker.cs rename to src/EventHub.BackgroundServices/Events/NewEventDetectorWorker.cs index 6694e9b..24cb51e 100644 --- a/src/EventHub.Application/Events/NewEventDetectorWorker.cs +++ b/src/EventHub.BackgroundServices/Events/NewEventDetectorWorker.cs @@ -13,8 +13,12 @@ namespace EventHub.Events { public class NewEventDetectorWorker : AsyncPeriodicBackgroundWorkerBase { - public NewEventDetectorWorker(AbpAsyncTimer timer, IServiceScopeFactory serviceScopeFactory) - : base(timer, serviceScopeFactory) + public NewEventDetectorWorker( + AbpAsyncTimer timer, + IServiceScopeFactory serviceScopeFactory) + : base( + timer, + serviceScopeFactory) { Timer.Period = 60_000; } @@ -26,23 +30,22 @@ namespace EventHub.Events var eventRepository = workerContext.ServiceProvider.GetRequiredService>(); var asyncExecuter = workerContext.ServiceProvider.GetRequiredService(); - var eventQueryable = await eventRepository.GetQueryableAsync(); - - var eventQuery = eventQueryable.Where(x => x.IsEmailSentToMembers == false); + var queryable = await eventRepository.GetQueryableAsync(); + var newEvents = await asyncExecuter.ToListAsync( + queryable.Where(x => x.IsEmailSentToMembers == false) + ); - var newEvents = await asyncExecuter.ToListAsync(eventQuery); - foreach (var @event in newEvents) { try { await newEventNotifier.NotifyAsync(@event); @event.IsEmailSentToMembers = true; + await eventRepository.UpdateAsync(@event); } - catch (Exception e) + catch (Exception ex) { - @event.IsEmailSentToMembers = false; - Logger.LogError($"An error occurred while sending an email to the members of the organization after the new event was created. Error message: {e.Message}"); + Logger.LogException(ex); } } } diff --git a/src/EventHub.Application/Events/NewEventNotifier.cs b/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs similarity index 75% rename from src/EventHub.Application/Events/NewEventNotifier.cs rename to src/EventHub.BackgroundServices/Events/NewEventNotifier.cs index 2e5f082..4110331 100644 --- a/src/EventHub.Application/Events/NewEventNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs @@ -16,15 +16,15 @@ namespace EventHub.Events { private readonly IEmailSender _emailSender; private readonly ITemplateRenderer _templateRenderer; - private readonly IRepository _organizationMembershipsRepository; + private readonly IRepository _organizationMembershipsRepository; private readonly IRepository _userRepository; private readonly IAsyncQueryableExecuter _asyncExecuter; public NewEventNotifier( - IEmailSender emailSender, + IEmailSender emailSender, ITemplateRenderer templateRenderer, - IRepository organizationMembershipsRepository, - IRepository userRepository, + IRepository organizationMembershipsRepository, + IRepository userRepository, IAsyncQueryableExecuter asyncExecuter) { _emailSender = emailSender; @@ -33,31 +33,23 @@ namespace EventHub.Events _userRepository = userRepository; _asyncExecuter = asyncExecuter; } - + public async Task NotifyAsync(Event @event) { - if (@event is null) - { - return; - } - - var organizationMembershipsQueryable = await _organizationMembershipsRepository.GetQueryableAsync(); - - var membershipQuery = organizationMembershipsQueryable - .Where(x => x.OrganizationId == @event.OrganizationId); - - var organizationMembers = await _asyncExecuter.ToListAsync(membershipQuery); + var queryable = await _organizationMembershipsRepository.GetQueryableAsync(); + var organizationMembers = await _asyncExecuter.ToListAsync( + queryable.Where(x => x.OrganizationId == @event.OrganizationId) + ); foreach (var member in organizationMembers) { var user = await _userRepository.FindAsync(member.UserId); - if (user is null) { continue; } - var model = new + var templateModel = new { UserName = user.GetFullNameOrUsername(), Title = @event.Title, @@ -65,12 +57,12 @@ namespace EventHub.Events EndTime = @event.EndTime, Url = @event.Url }; - + await _emailSender.QueueAsync( user.Email, $"Do you attend the {@event.Title} event?", - await _templateRenderer.RenderAsync(EmailTemplates.NewEventCreated, model) - ); + await _templateRenderer.RenderAsync(EmailTemplates.NewEventCreated, templateModel) + ); } } } diff --git a/src/EventHub.BackgroundServices/Program.cs b/src/EventHub.BackgroundServices/Program.cs new file mode 100644 index 0000000..2efdb19 --- /dev/null +++ b/src/EventHub.BackgroundServices/Program.cs @@ -0,0 +1,53 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace EventHub +{ + public class Program + { + public static async Task Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) + .WriteTo.Async(c => c.Console()) + .CreateLogger(); + + try + { + Log.Information("Starting console host."); + await CreateHostBuilder(args).RunConsoleAsync(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } + + } + + internal static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .UseAutofac() + .UseSerilog() + .ConfigureServices((hostContext, services) => + { + services.AddApplication(); + }); + } +} diff --git a/src/EventHub.BackgroundServices/appsettings.json b/src/EventHub.BackgroundServices/appsettings.json new file mode 100644 index 0000000..d177980 --- /dev/null +++ b/src/EventHub.BackgroundServices/appsettings.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/src/EventHub.Application/Emailing/EmailTemplateDefinitionProvider.cs b/src/EventHub.Domain/Emailing/EmailTemplateDefinitionProvider.cs similarity index 100% rename from src/EventHub.Application/Emailing/EmailTemplateDefinitionProvider.cs rename to src/EventHub.Domain/Emailing/EmailTemplateDefinitionProvider.cs diff --git a/src/EventHub.Application/Emailing/EmailTemplates.cs b/src/EventHub.Domain/Emailing/EmailTemplates.cs similarity index 100% rename from src/EventHub.Application/Emailing/EmailTemplates.cs rename to src/EventHub.Domain/Emailing/EmailTemplates.cs diff --git a/src/EventHub.Application/Emailing/Templates/EventRegistration.tpl b/src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl similarity index 100% rename from src/EventHub.Application/Emailing/Templates/EventRegistration.tpl rename to src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl diff --git a/src/EventHub.Application/Emailing/Templates/EventReminder.tpl b/src/EventHub.Domain/Emailing/Templates/EventReminder.tpl similarity index 100% rename from src/EventHub.Application/Emailing/Templates/EventReminder.tpl rename to src/EventHub.Domain/Emailing/Templates/EventReminder.tpl diff --git a/src/EventHub.Application/Emailing/Templates/EventTimingChanged.tpl b/src/EventHub.Domain/Emailing/Templates/EventTimingChanged.tpl similarity index 98% rename from src/EventHub.Application/Emailing/Templates/EventTimingChanged.tpl rename to src/EventHub.Domain/Emailing/Templates/EventTimingChanged.tpl index c63b6d9..871c34b 100644 --- a/src/EventHub.Application/Emailing/Templates/EventTimingChanged.tpl +++ b/src/EventHub.Domain/Emailing/Templates/EventTimingChanged.tpl @@ -1,157 +1,157 @@ - - - - - - Eventhub - - - - - - - - - - -
-
-
- -

EventHub

- -
- -
- -

{{model.title}} event time has been changed!

- -
- - - - - - - -
- - - - - - -
- - - - - - -
-
- - - - - - -
-

- Hi {{model.user_name}}, -

-

- The "{{model.title}}" event time just rescheduled. -

-
- - - - - - - - -
- -

Start Time

-

{{model.start_time}}

-
- -

End Time

-

{{model.end_time}}

-
-

- Event Details -

-
- -

- Thank you,
EventHub -

-
-
-
-
- -
- - - - - - - - - - -
-
- Home -
-
-
- info@eventhub.abp.io - EventHub - Powered by Volosoft -
-
-
- - -
- - + + + + + + Eventhub + + + + + + + + + + +
+
+
+ +

EventHub

+ +
+ +
+ +

{{model.title}} event time has been changed!

+ +
+ + + + + + + +
+ + + + + + +
+ + + + + + +
+
+ + + + + + +
+

+ Hi {{model.user_name}}, +

+

+ The "{{model.title}}" event time just rescheduled. +

+
+ + + + + + + + +
+ +

Start Time

+

{{model.start_time}}

+
+ +

End Time

+

{{model.end_time}}

+
+

+ Event Details +

+
+ +

+ Thank you,
EventHub +

+
+
+
+
+ +
+ + + + + + + + + + +
+
+ Home +
+
+
+ info@eventhub.abp.io + EventHub - Powered by Volosoft +
+
+
+ + +
+ + \ No newline at end of file diff --git a/src/EventHub.Application/Emailing/Templates/NewEventCreated.tpl b/src/EventHub.Domain/Emailing/Templates/NewEventCreated.tpl similarity index 100% rename from src/EventHub.Application/Emailing/Templates/NewEventCreated.tpl rename to src/EventHub.Domain/Emailing/Templates/NewEventCreated.tpl diff --git a/src/EventHub.Domain/EventHub.Domain.csproj b/src/EventHub.Domain/EventHub.Domain.csproj index 07ed47e..0d9681e 100644 --- a/src/EventHub.Domain/EventHub.Domain.csproj +++ b/src/EventHub.Domain/EventHub.Domain.csproj @@ -5,6 +5,7 @@ net5.0 EventHub + true @@ -23,4 +24,13 @@ + + + + + + + + + diff --git a/src/EventHub.Domain/EventHubDomainModule.cs b/src/EventHub.Domain/EventHubDomainModule.cs index a2de33f..000b842 100644 --- a/src/EventHub.Domain/EventHubDomainModule.cs +++ b/src/EventHub.Domain/EventHubDomainModule.cs @@ -10,6 +10,7 @@ using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.PermissionManagement.IdentityServer; using Volo.Abp.SettingManagement; using Volo.Abp.BlobStoring.Database; +using Volo.Abp.VirtualFileSystem; namespace EventHub { @@ -29,6 +30,11 @@ namespace EventHub { public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + #if DEBUG context.Services.Replace(ServiceDescriptor.Singleton()); #endif