mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
Send f4e offer email
This commit is contained in:
@ -757,7 +757,7 @@ namespace Bit.Core.Services
|
||||
await _mailDeliveryService.SendEmailAsync(message);
|
||||
}
|
||||
|
||||
public async Task SendFamiliesForEnterpriseInviteRedeemableEmailAsync(string email, string organizationName, string token)
|
||||
public async Task SendFamiliesForEnterpriseOfferEmailAsync(string email, string organizationName, string token)
|
||||
{
|
||||
// TODO: Complete emails
|
||||
var message = CreateDefaultMessage("A Family Organization Invite Is Redeemable", email);
|
||||
@ -780,7 +780,17 @@ namespace Bit.Core.Services
|
||||
await _mailDeliveryService.SendEmailAsync(message);
|
||||
}
|
||||
|
||||
public async Task SendFamiliesForEnterpriseInviteRedeemedToFamilyUserEmailAsync(string email)
|
||||
public async Task SendFamiliesForEnterpriseRedeemedEmailsAsync(string familyUserEmail, string sponsorEmail, string sponsorOrgName)
|
||||
{
|
||||
// TODO: complete emails
|
||||
// Email family user
|
||||
await SendFamiliesForEnterpriseInviteRedeemedToFamilyUserEmailAsync(familyUserEmail);
|
||||
|
||||
// Email enterprise org user
|
||||
await SendFamiliesForEnterpriseInviteRedeemedToOrgUserEmailAsync(sponsorEmail, sponsorOrgName);
|
||||
}
|
||||
|
||||
private async Task SendFamiliesForEnterpriseInviteRedeemedToFamilyUserEmailAsync(string email)
|
||||
{
|
||||
// TODO: Complete emails
|
||||
var message = CreateDefaultMessage("You Have Redeemed A Family Organization Sponsorship", email);
|
||||
@ -793,7 +803,7 @@ namespace Bit.Core.Services
|
||||
await _mailDeliveryService.SendEmailAsync(message);
|
||||
}
|
||||
|
||||
public async Task SendFamiliesForEnterpriseInviteRedeemedToOrgUserEmailAsync(string email, string organizationName)
|
||||
private async Task SendFamiliesForEnterpriseInviteRedeemedToOrgUserEmailAsync(string email, string organizationName)
|
||||
{
|
||||
// TODO: Complete emails
|
||||
var message = CreateDefaultMessage("A User Has Redeemeed Your Sponsorship", email);
|
||||
|
@ -16,16 +16,20 @@ namespace Bit.Core.Services
|
||||
private readonly IOrganizationSponsorshipRepository _organizationSponsorshipRepository;
|
||||
private readonly IOrganizationRepository _organizationRepository;
|
||||
private readonly IPaymentService _paymentService;
|
||||
private readonly IMailService _mailService;
|
||||
|
||||
private readonly IDataProtector _dataProtector;
|
||||
|
||||
public OrganizationSponsorshipService(IOrganizationSponsorshipRepository organizationSponsorshipRepository,
|
||||
IOrganizationRepository organizationRepository,
|
||||
IPaymentService paymentService,
|
||||
IMailService mailService,
|
||||
IDataProtectionProvider dataProtectionProvider)
|
||||
{
|
||||
_organizationSponsorshipRepository = organizationSponsorshipRepository;
|
||||
_organizationRepository = organizationRepository;
|
||||
_paymentService = paymentService;
|
||||
_mailService = mailService;
|
||||
_dataProtector = dataProtectionProvider.CreateProtector("OrganizationSponsorshipServiceDataProtector");
|
||||
}
|
||||
|
||||
@ -87,8 +91,8 @@ namespace Bit.Core.Services
|
||||
{
|
||||
sponsorship = await _organizationSponsorshipRepository.CreateAsync(sponsorship);
|
||||
|
||||
// TODO: send email to sponsoredEmail w/ redemption token link
|
||||
// var _ = RedemptionToken(sponsorship.Id, sponsorshipType);
|
||||
await _mailService.SendFamiliesForEnterpriseOfferEmailAsync(sponsoredEmail, sponsoringOrg.Name,
|
||||
RedemptionToken(sponsorship.Id, sponsorshipType));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Reference in New Issue
Block a user