Solved

Replying to conversation with email thread

  • 9 March 2023
  • 3 replies
  • 116 views

Badge

Hey,

When using the Reply to Conversation endpoint, I would like the email thread of the conversation to be added at the bottom of the message. This would provide a behavior similar to replying straight through the Front application.

What would be the best way to achieve that?

 

Thanks ✌️

 

icon

Best answer by jason 30 March 2023, 20:53

View original

3 replies

Userlevel 4
Badge +7

Hi Guy,

Unfortunately this isn’t supported via the API right now, but please feel free to raise a feature request via our ideas portal

Badge

Hey Jason, thanks for the answer.

I was thinking maybe mimicking this behavior by fetching the last message of the conversation and adding it at the bottom of the `body` in the API call.

Do you know what would make email clients identify that it is the email thread ?

Userlevel 4
Badge +7

Sorry for the long wait here.

We very recently introduced a `quote_body` param in the Reply to conversation endpoint - this should solve your problem. 

Sending that as the HTML from the previous message should have the effect you’re looking for.

 

curl --request POST \

     --url https://api2.frontapp.com/conversations/cnv_123/messages \

     --header 'accept: application/json' \

     --header 'content-type: application/json' \

     --data '

{

  "to": [

    "recipient@example.com"

  ],

  "options": {

    "archive": true

  },

  "quote_body": "<p>Message that needs a reply</p>",

  "body": "<p>My message</p>",

  "text": "My message"

}

'

Reply