forked from radutopala/TSSAutomailerBundle
-
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.
- Loading branch information
1 parent
227e329
commit 591817c
Showing
6 changed files
with
69 additions
and
8 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
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
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
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,45 @@ | ||
<?php | ||
|
||
namespace TSS\AutomailerBundle\Library; | ||
|
||
/** | ||
* Beanstalk queuing plugin for Swiftmailer | ||
* | ||
* @package Automailer | ||
* @author Radu Topala | ||
*/ | ||
class BeanstalkPlugin implements \Swift_Events_SendListener | ||
{ | ||
|
||
public $container; | ||
|
||
public function __construct($container) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* Not used. | ||
*/ | ||
public function beforeSendPerformed(\Swift_Events_SendEvent $evt) | ||
{ | ||
} | ||
|
||
/** | ||
* Invoked immediately after the Message is sent. | ||
* | ||
* @param Swift_Events_SendEvent $evt | ||
*/ | ||
public function sendPerformed(\Swift_Events_SendEvent $evt) | ||
{ | ||
if($this->container->has("leezy.pheanstalk")) { | ||
|
||
//put a job into pheanstalk default connection, in automailer queue | ||
$pheanstalk = $this->container->get("leezy.pheanstalk"); | ||
|
||
$pheanstalk | ||
->useTube('automailer') | ||
->put("swiftmailer:spool:send --time-limit=500"); | ||
} | ||
} | ||
} |
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
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