From 6b484e29a7b257d10ed996af29a70dfda73cf77b Mon Sep 17 00:00:00 2001 From: Justin Baur <136baur@gmail.com> Date: Mon, 16 May 2022 09:50:33 -0400 Subject: [PATCH] Switch to sending org name in cloud invite (#2002) --- src/Api/Controllers/OrganizationSponsorshipsController.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Api/Controllers/OrganizationSponsorshipsController.cs b/src/Api/Controllers/OrganizationSponsorshipsController.cs index 9a9732b72..190ebcba8 100644 --- a/src/Api/Controllers/OrganizationSponsorshipsController.cs +++ b/src/Api/Controllers/OrganizationSponsorshipsController.cs @@ -70,11 +70,13 @@ namespace Bit.Api.Controllers [SelfHosted(NotSelfHostedOnly = true)] public async Task CreateSponsorship(Guid sponsoringOrgId, [FromBody] OrganizationSponsorshipCreateRequestModel model) { + var sponsoringOrg = await _organizationRepository.GetByIdAsync(sponsoringOrgId); + var sponsorship = await _createSponsorshipCommand.CreateSponsorshipAsync( - await _organizationRepository.GetByIdAsync(sponsoringOrgId), + sponsoringOrg, await _organizationUserRepository.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default), model.PlanSponsorshipType, model.SponsoredEmail, model.FriendlyName); - await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(sponsorship, (await CurrentUser).Email); + await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(sponsorship, sponsoringOrg.Name); } [Authorize("Application")]