IMessage.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OCP\Mail;
  26. /**
  27. * Interface IMessage
  28. *
  29. * @since 13.0.0
  30. */
  31. interface IMessage {
  32. /**
  33. * @param IAttachment $attachment
  34. * @return IMessage
  35. * @since 13.0.0
  36. */
  37. public function attach(IAttachment $attachment): IMessage;
  38. /**
  39. * Set the from address of this message.
  40. *
  41. * If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
  42. *
  43. * @param array $addresses Example: array('sender@domain.org', 'other@domain.org' => 'A name')
  44. * @return IMessage
  45. * @since 13.0.0
  46. */
  47. public function setFrom(array $addresses): IMessage;
  48. /**
  49. * Set the Reply-To address of this message
  50. *
  51. * @param array $addresses
  52. * @return IMessage
  53. * @since 13.0.0
  54. */
  55. public function setReplyTo(array $addresses): IMessage;
  56. /**
  57. * Set the to addresses of this message.
  58. *
  59. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  60. * @return IMessage
  61. * @since 13.0.0
  62. */
  63. public function setTo(array $recipients): IMessage;
  64. /**
  65. * Set the CC recipients of this message.
  66. *
  67. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  68. * @return IMessage
  69. * @since 13.0.0
  70. */
  71. public function setCc(array $recipients): IMessage;
  72. /**
  73. * Set the BCC recipients of this message.
  74. *
  75. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  76. * @return IMessage
  77. * @since 13.0.0
  78. */
  79. public function setBcc(array $recipients): IMessage;
  80. /**
  81. * @param IEMailTemplate $emailTemplate
  82. * @return IMessage
  83. * @since 13.0.0
  84. */
  85. public function useTemplate(IEMailTemplate $emailTemplate): IMessage;
  86. }