1
0
mirror of https://github.com/bitwarden/server synced 2025-12-23 03:33:35 +00:00

Add resend sponsorship offer api endpoint

This commit is contained in:
Matt Gibson
2021-11-10 17:00:48 -05:00
committed by Justin Baur
parent a605dc7286
commit 32333048b4
5 changed files with 172 additions and 24 deletions

View File

@@ -10,6 +10,7 @@ namespace Bit.Core.Services
Task<bool> ValidateRedemptionTokenAsync(string encryptedToken);
Task OfferSponsorshipAsync(Organization sponsoringOrg, OrganizationUser sponsoringOrgUser,
PlanSponsorshipType sponsorshipType, string sponsoredEmail, string friendlyName);
Task SendSponsorshipOfferAsync(Organization sponsoringOrg, OrganizationSponsorship sponsorship);
Task SetUpSponsorshipAsync(OrganizationSponsorship sponsorship, Organization sponsoredOrganization);
Task<bool> ValidateSponsorshipAsync(Guid sponsoredOrganizationId);
Task RemoveSponsorshipAsync(Organization sponsoredOrganization, OrganizationSponsorship sponsorship);

View File

@@ -91,6 +91,7 @@ namespace Bit.Core.Services
{
sponsorship = await _organizationSponsorshipRepository.CreateAsync(sponsorship);
await SendSponsorshipOfferAsync(sponsoringOrg, sponsorship);
await _mailService.SendFamiliesForEnterpriseOfferEmailAsync(sponsoredEmail, sponsoringOrg.Name,
RedemptionToken(sponsorship.Id, sponsorshipType));
}
@@ -104,6 +105,12 @@ namespace Bit.Core.Services
}
}
public async Task SendSponsorshipOfferAsync(Organization sponsoringOrg, OrganizationSponsorship sponsorship)
{
await _mailService.SendFamiliesForEnterpriseOfferEmailAsync(sponsorship.OfferedToEmail, sponsoringOrg.Name,
RedemptionToken(sponsorship.Id, sponsorship.PlanSponsorshipType.Value));
}
public async Task SetUpSponsorshipAsync(OrganizationSponsorship sponsorship, Organization sponsoredOrganization)
{
if (sponsorship.PlanSponsorshipType == null)