Record Class EmailEnvelope

java.lang.Object
java.lang.Record
io.leandev.appfuse.notification.channel.EmailEnvelope
Record Components:
to - 正本收件人位址
cc - 副本收件人位址(可為空,不可為 null)
subject - 主旨
htmlBody - HTML 內文
deliveryId - opaque 技術遞送識別;同一 Outbox 列重試時保持不變,供 provider idempotency; 舊呼叫端可為 null

public record EmailEnvelope(String to, List<String> cc, String subject, String htmlBody, String deliveryId) extends Record

EMAIL 通道交給應用層寄送的單封郵件信封。

to 是正本收件人;cc 是同一封郵件的副本標頭。主旨與內文只有一份,所有收件人看到 相同內容。位址禁止 CR/LF,避免郵件標頭注入。

Since:
4.0.0
  • Constructor Details

    • EmailEnvelope

      public EmailEnvelope(String to, List<String> cc, String subject, String htmlBody, String deliveryId)
      Creates an instance of a EmailEnvelope record class.
      Parameters:
      to - the value for the to record component
      cc - the value for the cc record component
      subject - the value for the subject record component
      htmlBody - the value for the htmlBody record component
      deliveryId - the value for the deliveryId record component
    • EmailEnvelope

      public EmailEnvelope(String to, List<String> cc, String subject, String htmlBody)
      相容舊版 constructor(未指定技術遞送識別)。
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • to

      public String to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • cc

      public List<String> cc()
      Returns the value of the cc record component.
      Returns:
      the value of the cc record component
    • subject

      public String subject()
      Returns the value of the subject record component.
      Returns:
      the value of the subject record component
    • htmlBody

      public String htmlBody()
      Returns the value of the htmlBody record component.
      Returns:
      the value of the htmlBody record component
    • deliveryId

      public String deliveryId()
      Returns the value of the deliveryId record component.
      Returns:
      the value of the deliveryId record component