diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index 63f94eae5..1cecf5165 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -7,10 +7,11 @@ using Ombi.Store.Entities.Requests; namespace Ombi.Notifications { public class NotificationMessageCurlys - { + { public void Setup(FullBaseRequest req, CustomizationSettings s) { + ApplicationUrl = s.ApplicationUrl; ApplicationName = string.IsNullOrEmpty(s.ApplicationName) ? "Ombi" : s.ApplicationName; RequestedUser = string.IsNullOrEmpty(req.RequestedUser.Alias) ? req.RequestedUser.UserName @@ -25,6 +26,7 @@ namespace Ombi.Notifications public void Setup(ChildRequests req, CustomizationSettings s) { + ApplicationUrl = s.ApplicationUrl; ApplicationName = string.IsNullOrEmpty(s.ApplicationName) ? "Ombi" : s.ApplicationName; RequestedUser = string.IsNullOrEmpty(req.RequestedUser.Alias) ? req.RequestedUser.UserName @@ -40,10 +42,11 @@ namespace Ombi.Notifications public void Setup(OmbiUser user, CustomizationSettings s) { + ApplicationUrl = s.ApplicationUrl; ApplicationName = string.IsNullOrEmpty(s.ApplicationName) ? "Ombi" : s.ApplicationName; RequestedUser = user.UserName; } - + // User Defined public string RequestedUser { get; set; } public string Title { get; set; } @@ -56,6 +59,7 @@ namespace Ombi.Notifications public string SeasonsList { get; set; } public string PosterImage { get; set; } public string ApplicationName { get; set; } + public string ApplicationUrl { get; set; } // System Defined private string LongDate => DateTime.Now.ToString("D"); @@ -80,6 +84,7 @@ namespace Ombi.Notifications {nameof(SeasonsList),SeasonsList}, {nameof(PosterImage),PosterImage}, {nameof(ApplicationName),ApplicationName}, + {nameof(ApplicationUrl),ApplicationUrl}, }; } } \ No newline at end of file diff --git a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs index 3227cdf24..a9340e633 100644 --- a/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs +++ b/src/Ombi.Settings/Settings/Models/CustomizationSettings.cs @@ -1,8 +1,29 @@ -namespace Ombi.Settings.Settings.Models +using Newtonsoft.Json; + +namespace Ombi.Settings.Settings.Models { public class CustomizationSettings : Settings { public string ApplicationName { get; set; } + public string ApplicationUrl { get; set; } + + public void AddToUrl(string part) + { + if (string.IsNullOrEmpty(ApplicationUrl)) + { + ApplicationUrl = part; + } + + if (ApplicationUrl.EndsWith("/")) + { + ApplicationUrl.Remove(ApplicationUrl.Length - 1); + } + if (!part.StartsWith("/")) + { + part = "/" + part; + } + ApplicationUrl = ApplicationUrl + part; + } public string Logo { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Store/Context/OmbiContext.cs b/src/Ombi.Store/Context/OmbiContext.cs index d38213cd3..68539aa42 100644 --- a/src/Ombi.Store/Context/OmbiContext.cs +++ b/src/Ombi.Store/Context/OmbiContext.cs @@ -170,7 +170,7 @@ namespace Ombi.Store.Context notificationToAdd = new NotificationTemplates { NotificationType = notificationType, - Message = "Hello! You have been invited to use {ApplicationName}!", + Message = "Hello! You have been invited to use {ApplicationName}! You can login here: {ApplicationUrl}", Subject = "Invite to {ApplicationName}", Agent = agent, Enabled = true, diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index 1f952b70e..ce9dc5b37 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -87,6 +87,7 @@ export interface ILandingPageSettings extends ISettings { export interface ICustomizationSettings extends ISettings { applicationName: string; + applicationUrl: string; logo: string; } diff --git a/src/Ombi/ClientApp/app/settings/customization/customization.component.html b/src/Ombi/ClientApp/app/settings/customization/customization.component.html index 84fb002e1..e3716a975 100644 --- a/src/Ombi/ClientApp/app/settings/customization/customization.component.html +++ b/src/Ombi/ClientApp/app/settings/customization/customization.component.html @@ -9,6 +9,13 @@ +