Skip to content

Commit

Permalink
fix(appManagement): fix emails not getting send on app approval or re…
Browse files Browse the repository at this point in the history
…jection (#1017)

* fix(appManagement): not getting Emails on the Rejection of App Release Request
* fix ApproveOfferRequestAsync not saving created mail-processes
Ref: 1015
---------
Co-authored-by: Norbert Truchsess <norbert.truchsess@t-online.de>
  • Loading branch information
tfjanjua authored Sep 20, 2024
1 parent 786a38e commit cd5ca62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
28 changes: 12 additions & 16 deletions src/marketplace/Offers.Library/Service/OfferService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,23 +485,21 @@ public async Task ApproveOfferRequestAsync(Guid offerId, OfferTypeId offerTypeId
await notificationService.CreateNotifications(approveOfferRoles, _identityData.IdentityId, content, offerDetails.ProviderCompanyId.Value).AwaitAll().ConfigureAwait(false);
await notificationService.SetNotificationsForOfferToDone(catenaAdminRoles, submitOfferNotificationTypeIds, offerId).ConfigureAwait(ConfigureAwaitOptions.None);

await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);

await mailingProcessCreation.RoleBaseSendMail(
notificationRecipients,
new[]
{
[
("offerName", offerDetails.OfferName),
("offerSubscriptionUrl", mailParams.SubscriptionUrl),
("offerDetailUrl", $"{mailParams.DetailUrl}/{offerId}"),
(offerTypeId == OfferTypeId.APP ? "appId" : "serviceId", offerId.ToString())
},
],
("offerProviderName", "User"),
new[]
{
[
$"{offerTypeId.ToString().ToLower()}-release-activation"
},
],
offerDetails.ProviderCompanyId.Value).ConfigureAwait(ConfigureAwaitOptions.None);

await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}

/// <inheritdoc />
Expand Down Expand Up @@ -560,22 +558,20 @@ public async Task DeclineOfferAsync(Guid offerId, OfferDeclineRequest data, Offe
await notificationService.CreateNotifications(notificationRecipients, _identityData.IdentityId, content, declineData.CompanyId.Value).AwaitAll().ConfigureAwait(false);
await notificationService.SetNotificationsForOfferToDone(catenaAdminRoles, submitOfferNotificationTypeIds, offerId).ConfigureAwait(ConfigureAwaitOptions.None);

await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);

await mailingProcessCreation.RoleBaseSendMail(
notificationRecipients,
new[]
{
[
("offerName", declineData.OfferName),
("url", basePortalAddress),
("declineMessage", data.Message),
},
],
("offerProviderName", "Service Manager"),
new[]
{
[
$"{offerType.ToString().ToLower()}-request-decline"
},
],
declineData.CompanyId.Value).ConfigureAwait(ConfigureAwaitOptions.None);

await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}

private async Task CheckLanguageCodesExist(IEnumerable<string> languageCodes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,14 @@ public async Task<Guid> AddOfferSubscriptionAsync(Guid offerId, IEnumerable<Offe

await _mailingProcessCreation.RoleBaseSendMail(
notificationRecipients,
new[]
{
[
("offerName", offerProviderDetails.OfferName!),
("url", basePortalAddress)
},
],
("offerProviderName", "User"),
new[]
{
[
$"{offerTypeId.ToString().ToLower()}-subscription-request"
},
],
offerProviderDetails.ProviderCompanyId.Value).ConfigureAwait(ConfigureAwaitOptions.None);
await _portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);

Expand Down

0 comments on commit cd5ca62

Please sign in to comment.