Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
plugin mgr
<?php
switch ($modx->event->name) {
case 'OnCommentSave':
if ($modx->context->key == 'mgr' && $mode == 'new') {
$scriptProperties = [
'tplCommentEmailReply' => 'tpl.Tickets.comment.email.reply',
'tplCommentEmailOwner' => 'tpl.Tickets.comment.email.owner',
'tplCommentEmailSubscription' => 'tpl.Tickets.comment.email.subscription',//чанк письма
'allowGuestEmails' => 1
];
$Tickets = $modx->getService('tickets', 'Tickets', $modx->getOption('tickets.core_path', null,
$modx->getOption('core_path') . 'components/tickets/') . 'model/tickets/', $scriptProperties);
$Tickets->initialize($modx->context->key, $scriptProperties);
$comment = $object->toArray();
if ($user = $modx->getObject('modUser', $comment['createdby'])) {
$profile = $user->getOne('Profile');
$comment = array_merge($profile->toArray(), $user->toArray(), $comment);
}
$Tickets->sendCommentMails($comment);
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.