CoreFiles by mySites.guru
MailerInterface.php139 lines, 3,679 bytes, from Joomla_4.4.14-Stable-Full_Package.zip
Raw History Compare with 4.4.13
md5
6e75d0e11c351c06c37fbf5d14aa80a8
sha1
c4eae1c8f932559e187d49f94eda5251a390fd6b
sha256
bcccb87fefdbee721e526fd4daf9850cbd701d1dc887df218726db672192810b
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Mail;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Provides a common interface to send emails with.
 *
 * @since  4.4.0
 */
interface MailerInterface
{
    /**
     * Send the mail. Throws an exception when something goes wrong.
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \RuntimeException
     */
    public function send();

    /**
     * Set the email sender.
     *
     * @param   string  $fromEmail  The Email address of the sender
     * @param   string  $name       The name of the sender
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \UnexpectedValueException  if the sender is not a valid address
     */
    public function setSender(string $fromEmail, string $name = '');

    /**
     * Set the email subject.
     *
     * @param   string  $subject  Subject of the email
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function setSubject(string $subject);

    /**
     * Set the email body.
     *
     * @param   string  $content  Body of the email
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function setBody(string $content);

    /**
     * Add a recipient to the email.
     *
     * @param   string  $recipientEmail  The email of the recipient
     * @param   string  $name            The name of the recipient
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \UnexpectedValueException  if the recipient is not a valid address
     */
    public function addRecipient(string $recipientEmail, string $name = '');

    /**
     * Add a carbon copy recipient to the email.
     *
     * @param   string  $ccEmail  The email of the CC recipient
     * @param   string  $name     The name of the CC recipient
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \UnexpectedValueException  if the CC is not a valid address
     */
    public function addCc(string $ccEmail, string $name = '');

    /**
     * Add a blind carbon copy recipient to the email.
     *
     * @param   string  $bccEmail  The email of the BCC recipient
     * @param   string  $name      The name of the BCC recipient
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \UnexpectedValueException  if the BCC is not a valid address
     */
    public function addBcc(string $bccEmail, string $name = '');

    /**
     * Add file attachment to the email.
     *
     * @param   string  $data         The data of the attachment
     * @param   string  $name         The name of the attachment
     * @param   string  $encoding     The encoding of the attachment
     * @param   string  $type         The mime type of the attachment
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function addAttachment(string $data, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream');

    /**
     * Add Reply to email address to the email
     *
     * @param   string  $replyToEmail  The email of the reply address
     * @param   string  $name          The name of the reply address
     *
     * @return  void
     *
     * @since   4.4.0
     *
     * @throws  \UnexpectedValueException  if the replay to is not a valid address
     */
    public function addReplyTo(string $replyToEmail, string $name = '');
}

The same content is in 188 releases, Joomla 4.4.0-alpha3 to 6.2.1-rc1. See them all, or every version of this file.