EmailTemplate.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Text.Json.Serialization;
  2. namespace qdr.app.studiou.orders2printpack.EmailStorage
  3. {
  4. /// <summary>
  5. /// Represents an email template that can be used to send personalized emails to recipients.
  6. /// Templates support placeholder replacement for dynamic content such as download links,
  7. /// passwords, recipient information, and order details.
  8. ///
  9. /// Common placeholders that can be used in Subject and Body:
  10. /// - {{DOWNLOAD_LINK}} - The download URL for the shared file
  11. /// - {{PASSWORD}} - The password required to access the download
  12. /// - {{RECIPIENT}} - The recipient's email address
  13. /// - {{ORDERS}} - Comma-separated list of order numbers
  14. /// </summary>
  15. public class EmailTemplate
  16. {
  17. /// <summary>
  18. /// Unique identifier/code for this email template.
  19. /// Used to reference specific templates in configuration or selection logic.
  20. /// Example: "STUDIO_PHOTOS", "ORDER_CONFIRMATION", etc.
  21. /// </summary>
  22. [JsonPropertyName("code")]
  23. [JsonRequired]
  24. public string Code { get; set; } = string.Empty;
  25. /// <summary>
  26. /// Email subject line template.
  27. /// Can contain placeholders that will be replaced with actual values
  28. /// when the email is prepared for sending.
  29. /// Example: "Your Studio Photos are Ready - Orders {{ORDERS}}"
  30. /// </summary>
  31. [JsonPropertyName("subject")]
  32. [JsonRequired]
  33. public string Subject { get; set; } = string.Empty;
  34. /// <summary>
  35. /// Email body template in HTML or plain text format.
  36. /// Supports placeholder replacement for personalization.
  37. /// Should include instructions for downloading files and using passwords.
  38. ///
  39. /// Example body might include:
  40. /// - Greeting with {{RECIPIENT}}
  41. /// - Download instructions with {{DOWNLOAD_LINK}}
  42. /// - Password information with {{PASSWORD}}
  43. /// - Order reference with {{ORDERS}}
  44. /// </summary>
  45. [JsonPropertyName("body")]
  46. [JsonRequired]
  47. public string Body { get; set; } = string.Empty;
  48. }
  49. }