MessageInterface.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Mail;
  7. /**
  8. * Mail Message interface
  9. *
  10. * @api
  11. * @deprecated 102.0.0 in favor of MailMessageInterface to avoid temporal coupling (setMessageType + setBody)
  12. * @see \Magento\Framework\Mail\MailMessageInterface
  13. * @since 100.0.2
  14. */
  15. interface MessageInterface
  16. {
  17. /**
  18. * Types of message
  19. * @deprecated
  20. */
  21. const TYPE_TEXT = 'text/plain';
  22. /**
  23. * @deprecated
  24. */
  25. const TYPE_HTML = 'text/html';
  26. /**
  27. * Set message subject
  28. *
  29. * @param string $subject
  30. * @return $this
  31. */
  32. public function setSubject($subject);
  33. /**
  34. * Get message subject
  35. *
  36. * @return string
  37. */
  38. public function getSubject();
  39. /**
  40. * Set message body
  41. *
  42. * @param mixed $body
  43. * @return $this
  44. *
  45. * @deprecated 102.0.0
  46. * @see \Magento\Framework\Mail\MailMessageInterface::setBodyHtml
  47. * @see \Magento\Framework\Mail\MailMessageInterface::setBodyText()
  48. */
  49. public function setBody($body);
  50. /**
  51. * Get message body
  52. *
  53. * @return string
  54. */
  55. public function getBody();
  56. /**
  57. * Set from address
  58. *
  59. * @param string|array $fromAddress
  60. * @return $this
  61. */
  62. public function setFrom($fromAddress);
  63. /**
  64. * Add to address
  65. *
  66. * @param string|array $toAddress
  67. * @return $this
  68. */
  69. public function addTo($toAddress);
  70. /**
  71. * Add cc address
  72. *
  73. * @param string|array $ccAddress
  74. * @return $this
  75. */
  76. public function addCc($ccAddress);
  77. /**
  78. * Add bcc address
  79. *
  80. * @param string|array $bccAddress
  81. * @return $this
  82. */
  83. public function addBcc($bccAddress);
  84. /**
  85. * Set reply-to address
  86. *
  87. * @param string|array $replyToAddress
  88. * @return $this
  89. */
  90. public function setReplyTo($replyToAddress);
  91. /**
  92. * Set message type
  93. *
  94. * @param string $type
  95. * @return $this
  96. *
  97. * @deprecated 102.0.0
  98. * @see \Magento\Framework\Mail\MailMessageInterface::setBodyHtml
  99. * @see \Magento\Framework\Mail\MailMessageInterface::getBodyHtml
  100. * @see \Magento\Framework\Mail\MailMessageInterface::setBodyText()
  101. * @see \Magento\Framework\Mail\MailMessageInterface::getBodyText()
  102. */
  103. public function setMessageType($type);
  104. }