1 | <?php |
||
22 | class Mail extends Base |
||
23 | { |
||
24 | /** |
||
25 | * Html Body mail message |
||
26 | * @var string |
||
27 | */ |
||
28 | public $body; |
||
29 | /** |
||
30 | * Subject for email |
||
31 | * @var string |
||
32 | */ |
||
33 | public $subject; |
||
34 | |||
35 | /** |
||
36 | * Constructor |
||
37 | * @param \stdClass $config |
||
38 | */ |
||
39 | public function __construct(\stdClass $config, PHPMailer $mailer = null) |
||
57 | |||
58 | /** |
||
59 | * Load parameters to PHPMailer class |
||
60 | * @param \stdClass $config |
||
61 | */ |
||
62 | protected function loadService(\stdClass $config) |
||
75 | |||
76 | /** |
||
77 | * Sets a template for body mail |
||
78 | * If no template is passed, it will be used a standard template |
||
79 | * see Base::class |
||
80 | * @param string $htmlTemplate |
||
81 | */ |
||
82 | public function loadTemplate($htmlTemplate) |
||
88 | |||
89 | /** |
||
90 | * Load the documents to send |
||
91 | * XML document is required, but PDF is not |
||
92 | * @param string $xml content or path NFe, CTe or CCe in XML |
||
93 | * @param string $pdf content or path document from NFe, CTe or CCe |
||
94 | */ |
||
95 | public function loadDocuments($xml, $pdf = '') |
||
108 | |||
109 | /** |
||
110 | * Checks if given data is file, handles mixed input |
||
111 | * @param mixed $value |
||
112 | * @return boolean |
||
113 | */ |
||
114 | private function isFile($value) |
||
119 | |||
120 | /** |
||
121 | * Send mail |
||
122 | * If no parameter was passed, only the email address contained in |
||
123 | * the xml will be used |
||
124 | * @param array $addresses |
||
125 | * @return boolean |
||
126 | * @throws \RuntimeException |
||
127 | */ |
||
128 | public function send(array $addresses = [], $include = true) |
||
152 | |||
153 | /** |
||
154 | * Configure and send documents |
||
155 | * @param \stdClass $config |
||
156 | * @param string $xml |
||
157 | * @param string $pdf |
||
158 | * @param array $addresses |
||
159 | * @param string $htmltemplate |
||
160 | * @param PHPMailer $mailer |
||
161 | * @return Mail |
||
162 | */ |
||
163 | public static function sendMail( |
||
177 | } |
||
178 |