IMessage.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. * @package OCP\Mail
  30. * @since 13.0.0
  31. */
  32. interface IMessage {
  33. /**
  34. * @param IAttachment $attachment
  35. * @return IMessage
  36. * @since 13.0.0
  37. */
  38. public function attach(IAttachment $attachment): IMessage;
  39. /**
  40. * Set the from address of this message.
  41. *
  42. * If no "From" address is used \OC\Mail\Mailer will use mail_from_address and mail_domain from config.php
  43. *
  44. * @param array $addresses Example: array('sender@domain.org', 'other@domain.org' => 'A name')
  45. * @return IMessage
  46. * @since 13.0.0
  47. */
  48. public function setFrom(array $addresses): IMessage;
  49. /**
  50. * Set the Reply-To address of this message
  51. *
  52. * @param array $addresses
  53. * @return IMessage
  54. * @since 13.0.0
  55. */
  56. public function setReplyTo(array $addresses): IMessage;
  57. /**
  58. * Set the to addresses of this message.
  59. *
  60. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  61. * @return IMessage
  62. * @since 13.0.0
  63. */
  64. public function setTo(array $recipients): IMessage;
  65. /**
  66. * Set the CC recipients of this message.
  67. *
  68. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  69. * @return IMessage
  70. * @since 13.0.0
  71. */
  72. public function setCc(array $recipients): IMessage;
  73. /**
  74. * Set the BCC recipients of this message.
  75. *
  76. * @param array $recipients Example: array('recipient@domain.org', 'other@domain.org' => 'A name')
  77. * @return IMessage
  78. * @since 13.0.0
  79. */
  80. public function setBcc(array $recipients): IMessage;
  81. /**
  82. * @param IEMailTemplate $emailTemplate
  83. * @return IMessage
  84. * @since 13.0.0
  85. */
  86. public function useTemplate(IEMailTemplate $emailTemplate): IMessage;
  87. }