| 1 |
<?php |
| 2 |
/** |
| 3 |
* Emails: Interface |
| 4 |
* |
| 5 |
* @package SimplePay |
| 6 |
* @copyright Copyright (c) 2023, Sandhills Development, LLC |
| 7 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 8 |
* @since 4.7.3 |
| 9 |
*/ |
| 10 |
|
| 11 |
namespace SimplePay\Core\Emails\Email; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* EmailInterface interface. |
| 19 |
* |
| 20 |
* @since 4.7.3 |
| 21 |
*/ |
| 22 |
interface EmailInterface { |
| 23 |
|
| 24 |
/** |
| 25 |
* Returns the unique ID of the email. |
| 26 |
* |
| 27 |
* @since 4.7.3 |
| 28 |
* |
| 29 |
* @return string |
| 30 |
*/ |
| 31 |
public function get_id(); |
| 32 |
|
| 33 |
/** |
| 34 |
* Returns the type of email. |
| 35 |
* |
| 36 |
* @since 4.7.3 |
| 37 |
* |
| 38 |
* @return string 'internal' or 'external'. |
| 39 |
*/ |
| 40 |
public function get_type(); |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns the label of the email. |
| 44 |
* |
| 45 |
* @since 4.7.3 |
| 46 |
* |
| 47 |
* @return string |
| 48 |
*/ |
| 49 |
public function get_label(); |
| 50 |
|
| 51 |
/** |
| 52 |
* Returns the descriptor of the email. |
| 53 |
* |
| 54 |
* @since 4.7.3 |
| 55 |
* |
| 56 |
* @return string |
| 57 |
*/ |
| 58 |
public function get_description(); |
| 59 |
|
| 60 |
/** |
| 61 |
* Returns the template the email should use. |
| 62 |
* |
| 63 |
* @since 4.7.3 |
| 64 |
* |
| 65 |
* @return \SimplePay\Core\Emails\Template\TemplateInterface |
| 66 |
*/ |
| 67 |
public function get_template(); |
| 68 |
|
| 69 |
/** |
| 70 |
* Returns a list of license levels the email is available for. |
| 71 |
* |
| 72 |
* @since 4.7.3 |
| 73 |
* |
| 74 |
* @return array<string> |
| 75 |
*/ |
| 76 |
public function get_licenses(); |
| 77 |
|
| 78 |
/** |
| 79 |
* Determines if the email is available for use. |
| 80 |
* |
| 81 |
* This is usually determined by the current license level. |
| 82 |
* |
| 83 |
* @since 4.7.3 |
| 84 |
* |
| 85 |
* @return bool |
| 86 |
*/ |
| 87 |
public function is_available(); |
| 88 |
|
| 89 |
/** |
| 90 |
* Determines if the email is enabled (usually via a UI) and should send. |
| 91 |
* |
| 92 |
* @since 4.7.3 |
| 93 |
* |
| 94 |
* @return bool |
| 95 |
*/ |
| 96 |
public function is_enabled(); |
| 97 |
|
| 98 |
/** |
| 99 |
* Returns the header content to load inside the template header. |
| 100 |
* |
| 101 |
* @since 4.7.3 |
| 102 |
* |
| 103 |
* @return string |
| 104 |
*/ |
| 105 |
public function get_header_content(); |
| 106 |
|
| 107 |
/** |
| 108 |
* Returns the footer content to load inside the template footer. |
| 109 |
* |
| 110 |
* @since 4.7.3 |
| 111 |
* |
| 112 |
* @return string |
| 113 |
*/ |
| 114 |
public function get_footer_content(); |
| 115 |
|
| 116 |
} |
| 117 |
|