Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for email notification bodies #709

Merged
merged 12 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>1.2.2</AssemblyVersion>
<Version>2024.12.14.0307</Version>
<AssemblyVersion>1.2.3</AssemblyVersion>
<Version>2024.12.19.0417</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand Down Expand Up @@ -67,7 +67,7 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
Expand Down
3 changes: 2 additions & 1 deletion BLAZAM/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
{
if (Monitor.AppReady == ServiceConnectionState.Up)
{
waitingForLoadToComplete = false;
await Task.Delay(2500); // Initial delay
Nav.NavigateTo("/install", true);
}
Expand All @@ -95,7 +96,7 @@
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
Monitor.OnAppReadyChanged += AppReady;
//Monitor.OnAppReadyChanged += AppReady;

}
private void AppReady(ServiceConnectionState newStatus)
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMActiveDirectory/BLAZAMActiveDirectory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMCommon/BLAZAMCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="System.DirectoryServices" Version="9.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="9.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
@EntryName @AppLocalization["has been assigned to"])
@EntryName @AppLocalization["has been assigned to"]) @GroupName
<br/>


Expand All @@ -17,11 +17,15 @@
@code{
[Parameter]
public string EntryName { get; set; }

public override string Render() => new ComponentRenderer<EntryUnassignedEmailMessage>()

[Parameter]
public string GroupName { get; set; }
public override string Render() => new ComponentRenderer<EntryAssignedEmailMessage>()
.UseLayout<DefaultEmailLayout>()
.AddServiceProvider(ApplicationInfo.services)
.Set(c => c.EntryName, EntryName).Render();
.Set(c => c.EntryName, EntryName)

.Set(c => c.GroupName, GroupName).Render();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
EntryName + AppLocalization[" has been created."])
@EntryName @AppLocalization[" has been created."]
<br/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
@EntryName @AppLocalization["has been unassigned from"])
@EntryName @AppLocalization["has been unassigned from"] @GroupName
<br/>


Expand All @@ -17,11 +17,15 @@
@code{
[Parameter]
public string EntryName { get; set; }
[Parameter]
public string GroupName { get; set; }

public override string Render() => new ComponentRenderer<EntryUnassignedEmailMessage>()
.UseLayout<DefaultEmailLayout>()
.AddServiceProvider(ApplicationInfo.services)
.Set(c => c.EntryName, EntryName).Render();
.Set(c => c.EntryName, EntryName)
.Set(c => c.GroupName, GroupName)
.Render();
}


Expand Down
4 changes: 2 additions & 2 deletions BLAZAMServices/BLAZAMServices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<PackageReference Include="DuoUniversal" Version="1.2.5" />
<PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="PreMailer.Net" Version="2.6.0" />
</ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions BLAZAMServices/Background/NotificationGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public void PackageNotification(IDirectoryEntryAdapter source, NotificationType
notificationBody += _appLocalization["was removed from"] + " <a href=\"" + target.SearchUri + "\" class=\"mud-typography mud-link mud-primary-text mud-link-underline-hover mud-typography-caption\">" + target.CanonicalName + "</a> " + _appLocalization[" at "] + time;

var groupMemberRemovedMessage = NotificationType.Unassign.ToNotification<EntryUnassignedEmailMessage>();
groupMemberRemovedMessage.EntryName = source.CanonicalName;
groupMemberRemovedMessage.EntryName = source?.CanonicalName;
groupMemberRemovedMessage.GroupName = target?.CanonicalName;
emailMessage = groupMemberRemovedMessage;
break;
case NotificationType.Assign:
Expand All @@ -201,7 +202,9 @@ public void PackageNotification(IDirectoryEntryAdapter source, NotificationType
notificationBody += _appLocalization["was assigned to"] + " <a href=\"" + target.SearchUri + "\" class=\"mud-typography mud-link mud-primary-text mud-link-underline-hover mud-typography-caption\">" + target.CanonicalName + "</a> " + _appLocalization[" at "] + time;

var groupMemberAssignedMessage = NotificationType.Assign.ToNotification<EntryAssignedEmailMessage>();
groupMemberAssignedMessage.EntryName = source.CanonicalName;
groupMemberAssignedMessage.EntryName = source?.CanonicalName;
groupMemberAssignedMessage.GroupName = target?.CanonicalName;

emailMessage = groupMemberAssignedMessage;
break;
case NotificationType.PasswordChange:
Expand Down
Loading