1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

PM-23761 added PR comments and clean up response format

This commit is contained in:
voommen-livefront
2025-09-12 09:54:29 -05:00
parent 556e84166c
commit 21f68230a0
2 changed files with 16 additions and 6 deletions

View File

@@ -294,18 +294,28 @@ public class FreshdeskController : Controller
}
// convert note from markdown to html
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
note = Markdig.Markdown.ToHtml(note, pipeline);
var htmlNote = note;
try
{
var pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
htmlNote = Markdig.Markdown.ToHtml(note, pipeline);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error converting markdown to HTML for Freshdesk reply. Ticket Id: {0}. Note: {1}",
ticketId, note);
htmlNote = note; // fallback to the original note
}
// clear out any new lines that Freshdesk doesn't like
if (_billingSettings.FreshDesk.RemoveNewlinesInReplies)
{
note = note.Replace(Environment.NewLine, string.Empty);
htmlNote = htmlNote.Replace(Environment.NewLine, string.Empty);
}
var replyBody = new FreshdeskReplyRequestModel
{
Body = $"{_billingSettings.FreshDesk.AutoReplyGreeting}{note}{_billingSettings.FreshDesk.AutoReplySalutation}",
Body = $"{_billingSettings.FreshDesk.AutoReplyGreeting}{htmlNote}{_billingSettings.FreshDesk.AutoReplySalutation}",
};
var replyRequest = new HttpRequestMessage(HttpMethod.Post,

View File

@@ -74,8 +74,8 @@
"userFieldName": "cf_user",
"orgFieldName": "cf_org",
"removeNewlinesInReplies": true,
"autoReplyGreeting": "Greetings,<br /><br />Thank you for contacting Bitwarden. The reply below was generated by our AI agent based on your message:<br /><br />",
"autoReplySalutation": "<br /><br />If this response doesnt fully address your question, simply reply to this email and a member of our Customer Success team will be happy to assist you further.<br /><br /><p>Regards,<br />CS Team</p>"
"autoReplyGreeting": "<b>Greetings,</b><br /><br />Thank you for contacting Bitwarden. The reply below was generated by our AI agent based on your message:<br /><br />",
"autoReplySalutation": "<br /><br />If this response doesnt fully address your question, simply reply to this email and a member of our Customer Success team will be happy to assist you further.<br /><p><b>Best Regards,</b><br />The Bitwarden Customer Success Team</p>"
},
"onyx": {
"apiKey": "on_tenant_i-16a83ec44869babc4.aDffNn2k4UvtRt_9KdlV_3lfjiLFdOe4mdAiE3jJb4thWUGURVETwFg1Xrtg5rwLvfqfcw_F6U0V87arVkARd7qHQxmL5vaC4k8gPxh3hTKJKEE7Rkc3BJHOSAiT-leINjWvj44hpIuTRcWazz_zafZi-_D6123wplCb3PG6UtiGlyxcK8FJCZKp9IEM4UTTYXUHc7nWUVZuhiREGPd5J7T8LIWoenfkSJ1Vhi2PoLDI6msMOLfSGuLT_Ma_pJZl",