GraphMailSendDtos.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Text.Json.Serialization;
  2. namespace OASystem.API.OAMethodLib.MicrosoftGraphMailbox;
  3. public class GraphSendMailRequest
  4. {
  5. [JsonPropertyName("message")]
  6. public GraphSendMailMessage Message { get; set; } = new();
  7. [JsonPropertyName("saveToSentItems")]
  8. public bool SaveToSentItems { get; set; } = true;
  9. }
  10. public class GraphSendMailMessage
  11. {
  12. [JsonPropertyName("subject")]
  13. public string Subject { get; set; } = string.Empty;
  14. [JsonPropertyName("body")]
  15. public GraphSendMailBody Body { get; set; } = new();
  16. [JsonPropertyName("toRecipients")]
  17. public List<GraphSendMailRecipient> ToRecipients { get; set; } = new();
  18. }
  19. public class GraphSendMailBody
  20. {
  21. [JsonPropertyName("contentType")]
  22. public string ContentType { get; set; } = "Text";
  23. [JsonPropertyName("content")]
  24. public string Content { get; set; } = string.Empty;
  25. }
  26. public class GraphSendMailRecipient
  27. {
  28. [JsonPropertyName("emailAddress")]
  29. public GraphSendMailEmail EmailAddress { get; set; } = new();
  30. }
  31. public class GraphSendMailEmail
  32. {
  33. [JsonPropertyName("address")]
  34. public string Address { get; set; } = string.Empty;
  35. }