Solved

Is there a way to get message(s) currently selected by the user using the context API?

  • 14 March 2023
  • 4 replies
  • 88 views

Badge

Hi,

 

I’m currently working on a plugin that converts email messages to PDFs. To be able to do so, I need to know which messages are currently being selected by the user. However, there does not seem to be a way to list currently selected messages in Front’s context API, and to my knowledge we can only retrieve ALL of the messages inside a selected conversation using listMessages.

 

I would really appreciate if someone could give me pointers on this. Thank you 😄.

icon

Best answer by Maxime Haudebert 15 March 2023, 14:59

View original

4 replies

Badge +1

Hi there!

Assuming you meant “selected conversations” and not messages, this is achievable by subscribing to context updates (see here). As described in the docs, your plugin will receive a new Context every time its properties change, including multiple conversations being selected. 

The received Context will contain an array of conversations through which you’ll be able to iterate to retrieve their messages.

I hope this helps!

Badge

Assuming you meant “selected conversations” and not messages

Ah, no, I meant email messages in email threads. In my understanding email threads are mapped to “conversations” in Front, and what I want to do is to detect when a user selects an email message inside an email thread / conversation. There does not seem to be any way to do that using the context API.

Thank you nonetheless.

Badge +1

Thank you for those details, and apologies for my confusion! This is indeed not supported by our context API at the moment, but please feel free to raise a feature request via our ideas portal.

Badge

Thank you for those details, and apologies for my confusion! This is indeed not supported by our context API at the moment, but please feel free to raise a feature request via our ideas portal.

I see. No problem at all, and thank you again for your effort!

 

Reply