Skip to content

Commit

Permalink
Merge pull request #709 from Blazam-App/v1-Dev
Browse files Browse the repository at this point in the history
Fix for email notification bodies
  • Loading branch information
jacobsen9026 authored Dec 19, 2024
2 parents fd6f7d3 + ecd78b4 commit 96b517b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
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

0 comments on commit 96b517b

Please sign in to comment.