. */ /** * Mail implementation template. * * @since 4.6.0 * @package Mail */ namespace Textpattern\Mail; interface AdapterInterface extends \Textpattern\Adaptable\AdapterInterface { /** * Sets the subject. * * * Txp::get('\Textpattern\Mail\Compose')->subject('My subject'); * * * @param string $subject The subject * @return AdapterInterface * @throws \Textpattern\Mail\Exception */ public function subject($subject); /** * Sets the message. * * * Txp::get('\Textpattern\Mail\Compose')->body('Plain-text based message.'); * * * @param string $body The message * @return AdapterInterface * @throws \Textpattern\Mail\Exception */ public function body($body); /** * Sets an additional header. * * * Txp::get('\Textpattern\Mail\Compose')->header('X-Mailer', 'abc_plugin'); * * * @param string $name The header name * @param string $value The value * @return AdapterInterface * @throws \Textpattern\Mail\Exception */ public function header($name, $value); /** * Sends an email. * * * Txp::get('\Textpattern\Mail\Compose') * ->to('to@example.com') * ->from('from@example.com') * ->subject('Subject') * ->body('Hello world!') * ->send(); * * * @return AdapterInterface * @throws \Textpattern\Mail\Exception */ public function send(); }