mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
Switch to sending org name in cloud invite (#2002)
This commit is contained in:
parent
2e2d3075d1
commit
6b484e29a7
@ -70,11 +70,13 @@ namespace Bit.Api.Controllers
|
|||||||
[SelfHosted(NotSelfHostedOnly = true)]
|
[SelfHosted(NotSelfHostedOnly = true)]
|
||||||
public async Task CreateSponsorship(Guid sponsoringOrgId, [FromBody] OrganizationSponsorshipCreateRequestModel model)
|
public async Task CreateSponsorship(Guid sponsoringOrgId, [FromBody] OrganizationSponsorshipCreateRequestModel model)
|
||||||
{
|
{
|
||||||
|
var sponsoringOrg = await _organizationRepository.GetByIdAsync(sponsoringOrgId);
|
||||||
|
|
||||||
var sponsorship = await _createSponsorshipCommand.CreateSponsorshipAsync(
|
var sponsorship = await _createSponsorshipCommand.CreateSponsorshipAsync(
|
||||||
await _organizationRepository.GetByIdAsync(sponsoringOrgId),
|
sponsoringOrg,
|
||||||
await _organizationUserRepository.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default),
|
await _organizationUserRepository.GetByOrganizationAsync(sponsoringOrgId, _currentContext.UserId ?? default),
|
||||||
model.PlanSponsorshipType, model.SponsoredEmail, model.FriendlyName);
|
model.PlanSponsorshipType, model.SponsoredEmail, model.FriendlyName);
|
||||||
await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(sponsorship, (await CurrentUser).Email);
|
await _sendSponsorshipOfferCommand.SendSponsorshipOfferAsync(sponsorship, sponsoringOrg.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Authorize("Application")]
|
[Authorize("Application")]
|
||||||
|
Loading…
Reference in New Issue
Block a user