From 01e9c22695a3e495f07ab445750221af72e09fe4 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 5 Sep 2018 13:40:03 +0200 Subject: Implemented mailing abstraction Closes #434 --- src/Mail/EngelsystemMailer.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Mail/EngelsystemMailer.php (limited to 'src/Mail/EngelsystemMailer.php') diff --git a/src/Mail/EngelsystemMailer.php b/src/Mail/EngelsystemMailer.php new file mode 100644 index 00000000..17047cc8 --- /dev/null +++ b/src/Mail/EngelsystemMailer.php @@ -0,0 +1,35 @@ +view = $view; + } + + /** + * Send a template + * + * @param string $to + * @param string $subject + * @param string $template + * @param array $data + * @return int + */ + public function sendView($to, $subject, $template, $data = []): int + { + $body = $this->view->render($template, $data); + + return $this->send($to, $subject, $body); + } +} -- cgit v1.2.3-54-g00ecf