diff --git a/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs b/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs index c93e3f6..335116c 100644 --- a/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs +++ b/src/EventHub.Admin.HttpApi.Host/EventHubAdminHttpApiHostModule.cs @@ -6,7 +6,7 @@ using EventHub.Admin.Events; using EventHub.Admin.Organizations; using EventHub.Admin.Utils; using EventHub.EntityFrameworkCore; -using EventHub.Web; +using EventHub.Options; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; diff --git a/src/EventHub.Admin.Web/Pages/EventManagement.razor b/src/EventHub.Admin.Web/Pages/EventManagement.razor index cf4371b..f739e21 100644 --- a/src/EventHub.Admin.Web/Pages/EventManagement.razor +++ b/src/EventHub.Admin.Web/Pages/EventManagement.razor @@ -2,7 +2,7 @@ @using EventHub.Admin.Events @using EventHub.Admin.Permissions @using EventHub.Events -@using EventHub.Web +@using EventHub.Options @using Microsoft.AspNetCore.Authorization @using Microsoft.Extensions.Options @inherits EventHubComponentBase diff --git a/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor b/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor index 47d1167..65cc909 100644 --- a/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor +++ b/src/EventHub.Admin.Web/Pages/OrganizationManagement.razor @@ -1,8 +1,8 @@ @page "/organizations" @using EventHub.Admin.Organizations @using EventHub.Admin.Permissions +@using EventHub.Options @using EventHub.Organizations -@using EventHub.Web @using Microsoft.AspNetCore.Authorization @using Microsoft.Extensions.Options @using Volo.Abp.AspNetCore.Components.Notifications diff --git a/src/EventHub.Application/Events/Registrations/EventRegistrationNotifier.cs b/src/EventHub.Application/Events/Registrations/EventRegistrationNotifier.cs index baeca74..849b9f0 100644 --- a/src/EventHub.Application/Events/Registrations/EventRegistrationNotifier.cs +++ b/src/EventHub.Application/Events/Registrations/EventRegistrationNotifier.cs @@ -1,5 +1,9 @@ +using System; using System.Threading.Tasks; using EventHub.Emailing; +using EventHub.Options; +using EventHub.Users; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.Emailing; using Volo.Abp.Identity; @@ -11,13 +15,16 @@ namespace EventHub.Events.Registrations { private readonly IEmailSender _emailSender; private readonly ITemplateRenderer _templateRenderer; + private readonly EventHubUrlOptions _urlOptions; public EventRegistrationNotifier( IEmailSender emailSender, - ITemplateRenderer templateRenderer) + ITemplateRenderer templateRenderer, + IOptions urlOptions) { _emailSender = emailSender; _templateRenderer = templateRenderer; + _urlOptions = urlOptions.Value; } public async Task NotifyAsync( @@ -32,9 +39,13 @@ namespace EventHub.Events.Registrations var model = new { Title = @event.Title, + Description = @event.Description.TruncateWithPostfix(250, "..."), + Url = @event.Url, + FullNameOrUserName = user.GetFullNameOrUsername(), + ThumbnailUrl = $"{_urlOptions.Api.EnsureEndsWith('/')}api/eventhub/event/cover-image/{@event.Id}", StartTime = @event.StartTime, EndTime = @event.EndTime, - Url = @event.Url + Location = @event.IsOnline ? "Online" : $"{@event.City}, {@event.CountryName}" }; await _emailSender.QueueAsync( diff --git a/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs b/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs index d2b3944..f673b4c 100644 --- a/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs @@ -3,7 +3,11 @@ using System.Linq; using System.Threading.Tasks; using EventHub.Emailing; using EventHub.Events.Registrations; +using EventHub.Localization; +using EventHub.Options; using EventHub.Users; +using Microsoft.Extensions.Localization; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.Emailing; @@ -20,19 +24,25 @@ namespace EventHub.Events private readonly IRepository _userRepository; private readonly IRepository _eventRegistrationRepository; private readonly IAsyncQueryableExecuter _asyncExecuter; + private readonly EventHubUrlOptions _eventHubUrlOptions; + private readonly IStringLocalizer _localizer; public EventReminderNotifier( IEmailSender emailSender, ITemplateRenderer templateRenderer, IRepository userRepository, IRepository eventRegistrationRepository, - IAsyncQueryableExecuter asyncExecuter) + IAsyncQueryableExecuter asyncExecuter, + IOptions eventHubUrlOptions, + IStringLocalizer localizer) { _emailSender = emailSender; _templateRenderer = templateRenderer; _userRepository = userRepository; _eventRegistrationRepository = eventRegistrationRepository; _asyncExecuter = asyncExecuter; + _localizer = localizer; + _eventHubUrlOptions = eventHubUrlOptions.Value; } public async Task NotifyAsync(Event @event) @@ -60,7 +70,10 @@ namespace EventHub.Events Title = @event.Title, StartTime = @event.StartTime, EndTime = @event.EndTime, - Url = @event.Url + Url = @event.Url, + Address = @event.IsOnline ? _localizer["Online"] : $"{@event.City}, {@event.CountryName}", + Description = @event.Description.TruncateWithPostfix(250, "..."), + ImageUrl = _eventHubUrlOptions.Api.EnsureEndsWith('/') + $"api/eventhub/event/cover-image/{@event.Id}" }; await _emailSender.QueueAsync( diff --git a/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs b/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs index 8994768..8f5b2d4 100644 --- a/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs +++ b/src/EventHub.Domain.Shared/EventHubDomainSharedModule.cs @@ -1,5 +1,5 @@ using EventHub.Localization; -using EventHub.Web; +using EventHub.Options; using Microsoft.Extensions.DependencyInjection; using Payment; using Volo.Abp.AuditLogging; diff --git a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs b/src/EventHub.Domain.Shared/Options/EventHubUrlOptions.cs similarity index 98% rename from src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs rename to src/EventHub.Domain.Shared/Options/EventHubUrlOptions.cs index 72037e6..be034a0 100644 --- a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs +++ b/src/EventHub.Domain.Shared/Options/EventHubUrlOptions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Configuration; -namespace EventHub.Web +namespace EventHub.Options { public class EventHubUrlOptions { diff --git a/src/EventHub.Domain/Emailing/EventHubEmailTemplateRenderingEngine.cs b/src/EventHub.Domain/Emailing/EventHubEmailTemplateRenderingEngine.cs index 9021183..d49130f 100644 --- a/src/EventHub.Domain/Emailing/EventHubEmailTemplateRenderingEngine.cs +++ b/src/EventHub.Domain/Emailing/EventHubEmailTemplateRenderingEngine.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using EventHub.Web; +using EventHub.Options; using JetBrains.Annotations; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; @@ -13,10 +13,7 @@ using Volo.Abp.TextTemplating.Scriban; namespace EventHub.Emailing { [Dependency(ServiceLifetime.Transient, ReplaceServices = true)] - [ExposeServices( - typeof(ScribanTemplateRenderingEngine), - typeof(EventHubEmailTemplateRenderingEngine) - )] + [ExposeServices(typeof(ScribanTemplateRenderingEngine), typeof(EventHubEmailTemplateRenderingEngine))] public class EventHubEmailTemplateRenderingEngine : ScribanTemplateRenderingEngine { private readonly EventHubUrlOptions _options; diff --git a/src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl b/src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl index 0122747..7e0c88e 100644 --- a/src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl +++ b/src/EventHub.Domain/Emailing/Templates/EventRegistration.tpl @@ -1,43 +1,42 @@ -

- {{model.title}}

-

- Hi,

-

- Great news! You attended the "{{model.title}}" event. -

-

-

- - - - + + + +
+
+ + + + + + + + + + -

- Start Time

-

- {{model.start_time}}

- - - - - -
+

Great news, {{model.full_name_or_user_name}}! You are attending to the "{{model.title}}" event.

+
+ + + + + +
+ + +

{{model.title}}

+ {{model.start_time}} - {{model.end_time}} | {{model.location}} +
+
+

+ {{model.description}} +

+
- -

- End Time

-

- {{model.end_time}}

-
-

- Event - Details -

- -

\ No newline at end of file +
+ + Details + +
+ + diff --git a/src/EventHub.Domain/Emailing/Templates/EventReminder.tpl b/src/EventHub.Domain/Emailing/Templates/EventReminder.tpl index 6092a9e..09f8937 100644 --- a/src/EventHub.Domain/Emailing/Templates/EventReminder.tpl +++ b/src/EventHub.Domain/Emailing/Templates/EventReminder.tpl @@ -1,32 +1,25 @@ -

- {{model.title}}

-

- Hi {{model.user_name}},

-

- The "{{model.title}}" event will start very soon. -

-

-

- - - - - - - - -
- -

Start Time

-

{{model.start_time}}

-
- -

End Time

-

{{model.end_time}}

-
-

- Event Details -

-
-

\ No newline at end of file + + + + + + + + + +
+

+ Hey {{model.user_name}}, +
+ Just a friendly reminder to you that the event is soon! Looking forward to seeing you in the event! +

+ +


+

{{model.title}}

+ {{model.start_time}} - {{model.end_time}} | {{model.address}} +

{{model.description}}

+
+ Details +
+ + \ No newline at end of file diff --git a/src/EventHub.Domain/Emailing/Templates/Layout.tpl b/src/EventHub.Domain/Emailing/Templates/Layout.tpl index 29667ee..425cd2a 100644 --- a/src/EventHub.Domain/Emailing/Templates/Layout.tpl +++ b/src/EventHub.Domain/Emailing/Templates/Layout.tpl @@ -2,139 +2,63 @@ - - - EventHub Email - - + + + + + + +
+ www.openeventhub.com + Copyright © 2021 - All rights reserved. - -
- - - - - - - - - -
- - - - -
-
- - - - - -
- + - Create an Event -
- {{content}} -
-
-
- - - - - - - -
- -
- -
-
-
+ + View in browser + Unsubscribe + +
+ + + - \ No newline at end of file diff --git a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs index 78ad9fa..46dd615 100644 --- a/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs +++ b/src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs @@ -5,10 +5,10 @@ using System.IO; using System.Linq; using EventHub.EntityFrameworkCore; using EventHub.Events; +using EventHub.Options; using EventHub.Organizations; using EventHub.Organizations.Plans; using EventHub.Utils; -using EventHub.Web; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors; diff --git a/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs b/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs index 0408175..9e345db 100644 --- a/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs +++ b/src/EventHub.IdentityServer/EventHubIdentityServerModule.cs @@ -2,6 +2,7 @@ using System.IO; using System.Security.Cryptography.X509Certificates; using EventHub.EntityFrameworkCore; using EventHub.Localization; +using EventHub.Options; using EventHub.Utils; using EventHub.Web; using EventHub.Web.Theme; diff --git a/src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml b/src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml index 6603a88..9d52e16 100644 --- a/src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml +++ b/src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml @@ -3,6 +3,7 @@ @using Volo.Abp.Users @using EventHub.Web @using System.Net +@using EventHub.Options @inject ICurrentUser CurrentUser @inject IOptions UrlOptions diff --git a/src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml b/src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml index fa69bbe..4d32b6b 100644 --- a/src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml +++ b/src/EventHub.Web.Theme/Themes/EventHub/Components/MainNavbar/Default.cshtml @@ -6,6 +6,7 @@ @using EventHub.Localization @using EventHub.Web @using System.Net +@using EventHub.Options @inject ICurrentUser CurrentUser @inject ILanguageProvider LanguageProvider @inject IStringLocalizer L diff --git a/src/EventHub.Web.Theme/Themes/EventHub/Layouts/Application.cshtml b/src/EventHub.Web.Theme/Themes/EventHub/Layouts/Application.cshtml index 44082b6..662f711 100644 --- a/src/EventHub.Web.Theme/Themes/EventHub/Layouts/Application.cshtml +++ b/src/EventHub.Web.Theme/Themes/EventHub/Layouts/Application.cshtml @@ -12,6 +12,7 @@ @using EventHub.Web.Theme.Themes.EventHub.Components.Footer @using EventHub.Web.Theme.Themes.EventHub.Components.MainNavbar @using EventHub.Web.Theme.Themes.EventHub.Components.PageAlerts +@using EventHub.Options @inject IBrandingProvider BrandingProvider @inject IPageLayout PageLayout @inject IOptions UrlOptions diff --git a/src/EventHub.Web/EventHubWebModule.cs b/src/EventHub.Web/EventHubWebModule.cs index 115168d..783ff57 100644 --- a/src/EventHub.Web/EventHubWebModule.cs +++ b/src/EventHub.Web/EventHubWebModule.cs @@ -1,6 +1,7 @@ using System; using System.IO; using EventHub.Localization; +using EventHub.Options; using EventHub.Web.Menus; using EventHub.Web.Theme; using EventHub.Web.Theme.Bundling; diff --git a/src/EventHub.Web/Menus/EventHubMenuContributor.cs b/src/EventHub.Web/Menus/EventHubMenuContributor.cs index 9368404..d97c898 100644 --- a/src/EventHub.Web/Menus/EventHubMenuContributor.cs +++ b/src/EventHub.Web/Menus/EventHubMenuContributor.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using EventHub.Localization; +using EventHub.Options; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Account.Localization; diff --git a/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml b/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml index 3aba351..dae929d 100644 --- a/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_eventSection.cshtml @@ -1,3 +1,4 @@ +@using EventHub.Options @using EventHub.Web @using EventHub.Web.Pages.Events.Components.CreateOrEditEventArea @using Microsoft.AspNetCore.Http diff --git a/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_previewSection.cshtml b/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_previewSection.cshtml index 18d55ab..aa1f517 100644 --- a/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_previewSection.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/CreateOrEditEventArea/_previewSection.cshtml @@ -1,3 +1,4 @@ +@using EventHub.Options @using EventHub.Web @using EventHub.Web.Pages.Events @using EventHub.Web.Pages.Events.Components.CreateOrEditEventArea diff --git a/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml b/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml index 3130791..287302b 100644 --- a/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml +++ b/src/EventHub.Web/Pages/Events/Components/EventsArea/_eventListSection.cshtml @@ -1,3 +1,4 @@ +@using EventHub.Options @using EventHub.Web @using EventHub.Web.Pages.Events @using Microsoft.Extensions.Options diff --git a/src/EventHub.Web/Pages/Events/Detail.cshtml b/src/EventHub.Web/Pages/Events/Detail.cshtml index 8736659..6a095fe 100644 --- a/src/EventHub.Web/Pages/Events/Detail.cshtml +++ b/src/EventHub.Web/Pages/Events/Detail.cshtml @@ -6,6 +6,7 @@ @using EventHub.Web @using EventHub.Web.Pages.Events @using EventHub.Events +@using EventHub.Options @using EventHub.Web.Pages.Events.Components.AttendeesArea @using EventHub.Web.Pages.Events.Components.EventsArea @using EventHub.Web.Pages.Events.Components.LocationArea diff --git a/src/EventHub.Web/Pages/Index.cshtml b/src/EventHub.Web/Pages/Index.cshtml index 118aa4f..17e7483 100644 --- a/src/EventHub.Web/Pages/Index.cshtml +++ b/src/EventHub.Web/Pages/Index.cshtml @@ -1,6 +1,7 @@ @page @using System.Globalization @using EventHub.Localization +@using EventHub.Options @using EventHub.Web @using EventHub.Web.Pages.Events.Components.EventsArea @using Microsoft.AspNetCore.Mvc.Localization diff --git a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/_organizationListSection.cshtml b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/_organizationListSection.cshtml index 942abd3..df9f348 100644 --- a/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/_organizationListSection.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Components/OrganizationsArea/_organizationListSection.cshtml @@ -1,3 +1,4 @@ +@using EventHub.Options @using EventHub.Organizations @using EventHub.Web @using Microsoft.Extensions.Options diff --git a/src/EventHub.Web/Pages/Organizations/Edit.cshtml b/src/EventHub.Web/Pages/Organizations/Edit.cshtml index e5f91aa..212fbb9 100644 --- a/src/EventHub.Web/Pages/Organizations/Edit.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Edit.cshtml @@ -1,6 +1,7 @@ @page "/organization/edit/{name}" @inject IHtmlLocalizer L @using EventHub.Localization +@using EventHub.Options @using EventHub.Organizations @using EventHub.Web @using Microsoft.AspNetCore.Mvc.Localization diff --git a/src/EventHub.Web/Pages/Organizations/Profile.cshtml b/src/EventHub.Web/Pages/Organizations/Profile.cshtml index 42b7466..0e8b350 100644 --- a/src/EventHub.Web/Pages/Organizations/Profile.cshtml +++ b/src/EventHub.Web/Pages/Organizations/Profile.cshtml @@ -1,6 +1,7 @@ @page "/organizations/{name}" @inject IHtmlLocalizer L @using EventHub.Localization +@using EventHub.Options @using EventHub.Organizations @using EventHub.Web @using EventHub.Web.Pages.Events.Components.EventsArea diff --git a/src/EventHub.Web/Pages/Payment/PostCheckout.cshtml b/src/EventHub.Web/Pages/Payment/PostCheckout.cshtml index 5bb0f2b..79a5e14 100644 --- a/src/EventHub.Web/Pages/Payment/PostCheckout.cshtml +++ b/src/EventHub.Web/Pages/Payment/PostCheckout.cshtml @@ -1,5 +1,6 @@ @page @inherits Payment.Web.Pages.PaymentPageBase +@using EventHub.Options @using EventHub.Web @using Microsoft.Extensions.Options @using Payment.PaymentRequests diff --git a/src/EventHub.Web/wwwroot/assets/email/facebook.png b/src/EventHub.Web/wwwroot/assets/email/facebook.png new file mode 100644 index 0000000..746d42f Binary files /dev/null and b/src/EventHub.Web/wwwroot/assets/email/facebook.png differ diff --git a/src/EventHub.Web/wwwroot/assets/email/instagram.png b/src/EventHub.Web/wwwroot/assets/email/instagram.png new file mode 100644 index 0000000..018798a Binary files /dev/null and b/src/EventHub.Web/wwwroot/assets/email/instagram.png differ diff --git a/src/EventHub.Web/wwwroot/assets/email/twitter.png b/src/EventHub.Web/wwwroot/assets/email/twitter.png new file mode 100644 index 0000000..473ede4 Binary files /dev/null and b/src/EventHub.Web/wwwroot/assets/email/twitter.png differ