mirror of
https://github.com/bitwarden/server.git
synced 2025-05-11 22:52:15 -05:00
Resolve the send email bug (#5763)
This commit is contained in:
parent
7fe022e26f
commit
887fa46374
@ -116,7 +116,7 @@ public class OrganizationSponsorshipsController : Controller
|
|||||||
[Authorize("Application")]
|
[Authorize("Application")]
|
||||||
[HttpPost("{sponsoringOrgId}/families-for-enterprise/resend")]
|
[HttpPost("{sponsoringOrgId}/families-for-enterprise/resend")]
|
||||||
[SelfHosted(NotSelfHostedOnly = true)]
|
[SelfHosted(NotSelfHostedOnly = true)]
|
||||||
public async Task ResendSponsorshipOffer(Guid sponsoringOrgId)
|
public async Task ResendSponsorshipOffer(Guid sponsoringOrgId, [FromQuery] string sponsoredFriendlyName)
|
||||||
{
|
{
|
||||||
var freeFamiliesSponsorshipPolicy = await _policyRepository.GetByOrganizationIdTypeAsync(sponsoringOrgId,
|
var freeFamiliesSponsorshipPolicy = await _policyRepository.GetByOrganizationIdTypeAsync(sponsoringOrgId,
|
||||||
PolicyType.FreeFamiliesSponsorshipPolicy);
|
PolicyType.FreeFamiliesSponsorshipPolicy);
|
||||||
@ -129,11 +129,14 @@ public class OrganizationSponsorshipsController : Controller
|
|||||||
var sponsoringOrgUser = await _organizationUserRepository
|
var sponsoringOrgUser = await _organizationUserRepository
|
||||||
.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default);
|
.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default);
|
||||||
|
|
||||||
await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(
|
var sponsorships = await _organizationSponsorshipRepository.GetManyBySponsoringOrganizationAsync(sponsoringOrgId);
|
||||||
await _organizationRepository.GetByIdAsync(sponsoringOrgId),
|
var filteredSponsorship = sponsorships.FirstOrDefault(s => s.FriendlyName != null && s.FriendlyName.Equals(sponsoredFriendlyName, StringComparison.OrdinalIgnoreCase));
|
||||||
sponsoringOrgUser,
|
if (filteredSponsorship != null)
|
||||||
await _organizationSponsorshipRepository
|
{
|
||||||
.GetBySponsoringOrganizationUserIdAsync(sponsoringOrgUser.Id));
|
await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(
|
||||||
|
await _organizationRepository.GetByIdAsync(sponsoringOrgId),
|
||||||
|
sponsoringOrgUser, filteredSponsorship);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize("Application")]
|
[Authorize("Application")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user