Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolving some bugs to use this plugin in new version of mautic
- Loading branch information
Ferreira
committed
Mar 7, 2017
1 parent
36c3c9e
commit c0a07d9
Showing
11 changed files
with
1,061 additions
and
105 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,63 @@ | ||
<?php | ||
|
||
/* | ||
* @copyright 2016 Mautic Contributors. All rights reserved | ||
* @author Mautic | ||
* | ||
* @link http://mautic.org | ||
* | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\SmsBundle\EventListener; | ||
|
||
use Mautic\ChannelBundle\ChannelEvents; | ||
use Mautic\ChannelBundle\Event\ChannelEvent; | ||
use Mautic\ChannelBundle\Model\MessageModel; | ||
use Mautic\CoreBundle\EventListener\CommonSubscriber; | ||
use Mautic\LeadBundle\Model\LeadModel; | ||
use Mautic\ReportBundle\Model\ReportModel; | ||
|
||
/** | ||
* Class ChannelSubscriber. | ||
*/ | ||
class ChannelSubscriber extends CommonSubscriber | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
ChannelEvents::ADD_CHANNEL => ['onAddChannel', 90], | ||
]; | ||
} | ||
|
||
/** | ||
* @param ChannelEvent $event | ||
*/ | ||
public function onAddChannel(ChannelEvent $event) | ||
{ | ||
if (!empty($this->params['sms_enabled'])) { | ||
$event->addChannel( | ||
'sms', | ||
[ | ||
MessageModel::CHANNEL_FEATURE => [ | ||
'campaignAction' => 'sms.send_text_sms', | ||
'campaignDecisionsSupported' => [ | ||
'page.pagehit', | ||
'asset.download', | ||
'form.submit', | ||
], | ||
'lookupFormType' => 'sms_list', | ||
'repository' => 'MauticSmsBundle:Sms', | ||
], | ||
LeadModel::CHANNEL_FEATURE => [], | ||
ReportModel::CHANNEL_FEATURE => [ | ||
'table' => 'sms_messages', | ||
], | ||
] | ||
); | ||
} | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
|
||
/* | ||
* @copyright 2016 Mautic Contributors. All rights reserved | ||
* @author Mautic | ||
* | ||
* @link http://mautic.org | ||
* | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\SmsBundle\EventListener; | ||
|
||
use Mautic\ConfigBundle\ConfigEvents; | ||
use Mautic\ConfigBundle\Event\ConfigBuilderEvent; | ||
use Mautic\CoreBundle\EventListener\CommonSubscriber; | ||
|
||
/** | ||
* Class ConfigSubscriber. | ||
*/ | ||
class ConfigSubscriber extends CommonSubscriber | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
ConfigEvents::CONFIG_ON_GENERATE => ['onConfigGenerate', 0], | ||
]; | ||
} | ||
|
||
public function onConfigGenerate(ConfigBuilderEvent $event) | ||
{ | ||
$event->addForm([ | ||
'bundle' => 'SmsBundle', | ||
'formAlias' => 'smsconfig', | ||
'formTheme' => 'MauticSmsBundle:FormTheme\Config', | ||
'parameters' => $event->getParametersFromConfig('MauticSmsBundle'), | ||
]); | ||
} | ||
} |
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
Oops, something went wrong.