Textpattern | PHP Cross Reference | Content Management Systems |
Description: Mail implementation template.
1 <?php 2 3 /* 4 * Textpattern Content Management System 5 * http://textpattern.com 6 * 7 * Copyright (C) 2016 The Textpattern Development Team 8 * 9 * This file is part of Textpattern. 10 * 11 * Textpattern is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU General Public License 13 * as published by the Free Software Foundation, version 2. 14 * 15 * Textpattern 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 General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License 21 * along with Textpattern. If not, see <http://www.gnu.org/licenses/>. 22 */ 23 24 /** 25 * Mail implementation template. 26 * 27 * @since 4.6.0 28 * @package Mail 29 */ 30 31 namespace Textpattern\Mail; 32 33 interface AdapterInterface extends \Textpattern\Adaptable\AdapterInterface 34 { 35 /** 36 * Sets the subject. 37 * 38 * <code> 39 * Txp::get('\Textpattern\Mail\Compose')->subject('My subject'); 40 * </code> 41 * 42 * @param string $subject The subject 43 * @return AdapterInterface 44 * @throws \Textpattern\Mail\Exception 45 */ 46 47 public function subject($subject); 48 49 /** 50 * Sets the message. 51 * 52 * <code> 53 * Txp::get('\Textpattern\Mail\Compose')->body('Plain-text based message.'); 54 * </code> 55 * 56 * @param string $body The message 57 * @return AdapterInterface 58 * @throws \Textpattern\Mail\Exception 59 */ 60 61 public function body($body); 62 63 /** 64 * Sets an additional header. 65 * 66 * <code> 67 * Txp::get('\Textpattern\Mail\Compose')->header('X-Mailer', 'abc_plugin'); 68 * </code> 69 * 70 * @param string $name The header name 71 * @param string $value The value 72 * @return AdapterInterface 73 * @throws \Textpattern\Mail\Exception 74 */ 75 76 public function header($name, $value); 77 78 /** 79 * Sends an email. 80 * 81 * <code> 82 * Txp::get('\Textpattern\Mail\Compose') 83 * ->to('to@example.com') 84 * ->from('from@example.com') 85 * ->subject('Subject') 86 * ->body('Hello world!') 87 * ->send(); 88 * </code> 89 * 90 * @return AdapterInterface 91 * @throws \Textpattern\Mail\Exception 92 */ 93 94 public function send(); 95 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
title