Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
318 stars 46 forks source link

feature request: position inline and mentions in message #169

Closed jessekps closed 1 year ago

jessekps commented 1 year ago

In channel$send_message you can provide a vector of inline images and mentions but these get pasted at the end of the message. It would be nice if they could be included within the message, e.g. something like:

body = '<p>text</p><img src="c:/my_image.png"><p>Hey <at id="1"></at> and <at id="2"></at></p>'
inline = "c:/my_image.png"
mentions = list(a_team_member, a_second_team_member)

channel$send_message(body=body, content_type='html', inline=inline, mentions=mentions)

With the expected behavior that the mentions and images get included at the specified points in the text rather than at the end.

This already works (almost) for mentions. The correct names get inserted and styled in the text in the example above, only they show up again at the end of the message (this time unstyled an unclickable).

hongooi73 commented 1 year ago

I really don't want to get into the weeds of parsing HTML. For fine-grained control of email message bodies, use either emayili or blastula.

jessekps commented 1 year ago

I meant purely teams messages but fair enough. Would you consider a pull request for something like this?