John Staurt
John Staurt

Reputation: 225

Using Microsoft Graph Client Sdk is it possible to alter or modify the reply subject

Using Microsoft Graph Client Sdk is it possible to alter or modify the reply subject.

Currently I am only able to reply using a string which becomes the content body of the reply message.

Upvotes: 1

Views: 538

Answers (1)

Caitlin Russell
Caitlin Russell

Reputation: 596

Yes, you will have to do this in three parts:

  1. Create a new reply
  2. Update the message with your new content
  3. Post the response message

Here's a sample of how to do this in the SDK:

var replyMessage = await graphClient.Me.Messages[message.Id].CreateReply().Request().PostAsync();

var newReplyBody = new ItemBody();
newReplyBody.Content = "Response" + replyMessage.Body.Content;

replyMessage.Body = newReplyBody;
replyMessage.Subject = "New Subject";
await graphClient.Me.Messages[replyMessage.Id].Request().UpdateAsync(replyMessage);

await graphClient.Me.Messages[replyMessage.Id].Send().Request().PostAsync();

Upvotes: 1

Related Questions