forked from freescout-help-desk/freescout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restart swiftmailer after each email sent to remove temp files - closes
- Loading branch information
1 parent
3c3f25a
commit 1398f02
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Listeners; | ||
|
||
class RestartSwiftMailer | ||
{ | ||
|
||
/** | ||
* Create the event listener. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Handle the event. | ||
*/ | ||
public function handle($event) | ||
{ | ||
// Destroy Swift mailer to make it clean temp files. | ||
// https://github.com/freescout-helpdesk/freescout/issues/2949 | ||
// https://github.com/swiftmailer/swiftmailer/issues/1287#issuecomment-833505298 | ||
\App::forgetInstance('mailer'); | ||
\App::forgetInstance('swift.mailer'); | ||
\App::forgetInstance('swift.transport'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters