Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kanetei
Last active January 24, 2017 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanetei/dbfd9e688aef2587701bcf6ab857da20 to your computer and use it in GitHub Desktop.
Save kanetei/dbfd9e688aef2587701bcf6ab857da20 to your computer and use it in GitHub Desktop.
<?php
// application\bootstrap\app.php
Core::bind('\Concrete\Core\Workflow\BasicWorkflow', function() {
return new \Application\Src\Workflow\BasicWorkflow();
});
<?php
namespace Application\Src\Workflow;
use Concrete\Core\Workflow\Progress\Progress as WorkflowProgress;
use Core;
use PermissionKey;
class BasicWorkflow extends \Concrete\Core\Workflow\BasicWorkflow
{
protected function notify(
WorkflowProgress $wp,
$message,
$permission = 'notify_on_basic_workflow_entry',
$parameters = array()
)
{
$nk = PermissionKey::getByHandle($permission);
$nk->setPermissionObject($this);
$users = $nk->getCurrentlyActiveUsers($wp);
foreach ($users as $ui) {
$mh = Core::make('helper/mail');
$mh->addParameter('uName', $ui->getUserName());
$mh->to($ui->getUserEmail());
$mh->from('example@example.com', t('Basic Workflow'));
$mh->addParameter('message', $message);
foreach ($parameters as $key => $value) {
$mh->addParameter($key, $value);
}
$mh->addParameter('siteName', Core::make('config')->get('concrete.site'));
$mh->load('basic_workflow_notification');
$mh->sendMail();
unset($mh);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment