1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

freshdesk updates

This commit is contained in:
Kyle Spearrin 2020-02-06 22:25:02 -05:00
parent abe624b739
commit 16f718f2be

View File

@ -87,8 +87,8 @@ namespace Bit.Billing.Controllers
var user = await _userRepository.GetByEmailAsync(ticketContactEmail);
if(user != null)
{
note += $"User: {_globalSettings.BaseServiceUri.Admin}/users/edit/{user.Id}";
var tags = new List<string>();
note += $"<li>User: {_globalSettings.BaseServiceUri.Admin}/users/edit/{user.Id}</li>";
var tags = new HashSet<string>();
if(user.Premium)
{
tags.Add("Premium");
@ -96,20 +96,14 @@ namespace Bit.Billing.Controllers
var orgs = await _organizationRepository.GetManyByUserIdAsync(user.Id);
foreach(var org in orgs)
{
note += $"\n\nOrg, {org.Name}: " +
$"{_globalSettings.BaseServiceUri.Admin}/organizations/edit/{org.Id}";
note += $"<li>Org, {org.Name}: " +
$"{_globalSettings.BaseServiceUri.Admin}/organizations/edit/{org.Id}</li>";
var planName = GetAttribute<DisplayAttribute>(org.PlanType).Name.Split(" ").FirstOrDefault();
if(!string.IsNullOrWhiteSpace(planName))
{
tags.Add(string.Format("Org: {0}", planName));
}
}
var hasPaidOrg = orgs.Any(o => o.PlanType != Core.Enums.PlanType.Free &&
o.PlanType != Core.Enums.PlanType.Custom);
if(user.Premium || hasPaidOrg)
{
updateBody.Add("priority", 3);
}
if(tags.Any())
{
updateBody.Add("tags", tags);
@ -123,7 +117,7 @@ namespace Bit.Billing.Controllers
var noteBody = new Dictionary<string, object>
{
{ "body", note },
{ "body", $"<ul>{note}</ul>" },
{ "private", true }
};
var noteRequest = new HttpRequestMessage(HttpMethod.Post,