Working on more email stuff
This commit is contained in:
parent
2a6766c10e
commit
672d089b20
@ -47,6 +47,17 @@ class EmailSenderHelper {
|
||||
$emailBuilder->cc = $addressees->cc;
|
||||
$emailBuilder->bcc = $addressees->bcc;
|
||||
|
||||
foreach ($heskSettings['custom_fields'] as $k => $v) {
|
||||
$number = intval(str_replace('custom', '', $k));
|
||||
if ($v['use'] && $v['type'] == 'email' && !empty($ticket->customFields[$number])) {
|
||||
if ($v['value']['email_type'] == 'cc') {
|
||||
$emailBuilder->cc[] = $ticket->customFields[$number];
|
||||
} elseif ($v['value']['email_type'] == 'bcc') {
|
||||
$emailBuilder->bcc[] = $ticket->customFields[$number];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($modsForHeskSettings['attachments']) {
|
||||
$emailBuilder->attachments = $ticket->attachments;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
use BusinessLogic\Emails\EmailSenderHelper;
|
||||
use BusinessLogic\Exceptions\ValidationException;
|
||||
use BusinessLogic\Statuses\DefaultStatusForAction;
|
||||
use DataAccess\Statuses\StatusGateway;
|
||||
@ -38,13 +39,20 @@ class TicketCreator {
|
||||
*/
|
||||
private $verifiedEmailChecker;
|
||||
|
||||
function __construct($newTicketValidator, $trackingIdGenerator, $autoassigner, $statusGateway, $ticketGateway, $verifiedEmailChecker) {
|
||||
/**
|
||||
* @var $emailSenderHelper EmailSenderHelper
|
||||
*/
|
||||
private $emailSenderHelper;
|
||||
|
||||
function __construct($newTicketValidator, $trackingIdGenerator, $autoassigner,
|
||||
$statusGateway, $ticketGateway, $verifiedEmailChecker, $emailSenderHelper) {
|
||||
$this->newTicketValidator = $newTicketValidator;
|
||||
$this->trackingIdGenerator = $trackingIdGenerator;
|
||||
$this->autoassigner = $autoassigner;
|
||||
$this->statusGateway = $statusGateway;
|
||||
$this->ticketGateway = $ticketGateway;
|
||||
$this->verifiedEmailChecker = $verifiedEmailChecker;
|
||||
$this->emailSenderHelper = $emailSenderHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,9 @@ class EmailSenderHelperTest extends TestCase {
|
||||
$this->emailTemplateParser = $this->createMock(EmailTemplateParser::class);
|
||||
$this->basicEmailSender = $this->createMock(BasicEmailSender::class);
|
||||
$this->mailgunEmailSender = $this->createMock(MailgunEmailSender::class);
|
||||
$this->heskSettings = array();
|
||||
$this->heskSettings = array(
|
||||
'custom_fields' => array()
|
||||
);
|
||||
$this->modsForHeskSettings = array(
|
||||
'attachments' => 0,
|
||||
'use_mailgun' => 0,
|
||||
|
@ -246,4 +246,8 @@ class CreateTicketTest extends TestCase {
|
||||
//-- Act
|
||||
$this->ticketCreator->createTicketByCustomer($this->ticketRequest, $this->heskSettings, $this->modsForHeskSettings, $this->userContext);
|
||||
}
|
||||
|
||||
function testItSendsAnEmailToTheCustomerWhenTheTicketIsCreated() {
|
||||
//--
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user