IMessage.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\Mail;
  25. /**
  26. * Interface IMessage
  27. *
  28. * @package OCP\Mail
  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. }