12345678910111213141516171819202122232425262728293031323334 |
- <?php
- // Copyright 2019 Hackware SpA <human@hackware.cl>
- // This file is part of "Hackware Web Services Core" and is released under
- // the MIT License terms.
- // As far as I can say, this does not violate LGPL.
- // Check last paragraph of https://www.gnu.org/licenses/lgpl-java.html
- namespace Hawese\Core;
- use PHPMailer\PHPMailer\PHPMailer;
- /**
- * Mailer class
- *
- * This class shouldn't be directly called, since its instantiation is
- * already configured in ./Providers/MailerServiceProvider.php.
- *
- * Create a ready-to-go instance using `app(\Hawese\Core\Mailer::class)`.
- */
- class Mailer extends PHPMailer
- {
- public function send()
- {
- // Really send only on production, else dump mail into log file
- if (app()->environment() == 'production') {
- parent::send();
- } else {
- $this->preSend();
- app('log')->info($this->getSentMIMEMessage());
- }
- }
- }
|