Getting started on email sender for customer ticket creation
This commit is contained in:
parent
ca499d5eac
commit
b4dcbc9846
14
api/BusinessLogic/Emails/EmailBuilder.php
Normal file
14
api/BusinessLogic/Emails/EmailBuilder.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
||||
class EmailBuilder {
|
||||
private $to;
|
||||
private $cc;
|
||||
private $bcc;
|
||||
private $subject;
|
||||
private $message;
|
||||
private $htmlMessage;
|
||||
private $attachments;
|
||||
}
|
25
api/BusinessLogic/Emails/EmailSender.php
Normal file
25
api/BusinessLogic/Emails/EmailSender.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
||||
use BusinessLogic\Tickets\Attachment;
|
||||
use BusinessLogic\Tickets\Ticket;
|
||||
|
||||
interface EmailSender {
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings);
|
||||
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $ticket Ticket
|
||||
* @param $attachments Attachment[]
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmailWithTicket($emailBuilder, $ticket, $attachments, $heskSettings, $modsForHeskSettings);
|
||||
}
|
29
api/BusinessLogic/Emails/MailgunEmailSender.php
Normal file
29
api/BusinessLogic/Emails/MailgunEmailSender.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
||||
use BusinessLogic\Tickets\Attachment;
|
||||
use BusinessLogic\Tickets\Ticket;
|
||||
|
||||
class MailgunEmailSender implements EmailSender {
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmail() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $ticket Ticket
|
||||
* @param $attachments Attachment[]
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmailWithTicket($emailBuilder, $ticket, $attachments, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmailWithTicket() method.
|
||||
}
|
||||
}
|
29
api/BusinessLogic/Emails/PhpMailEmailSender.php
Normal file
29
api/BusinessLogic/Emails/PhpMailEmailSender.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
||||
use BusinessLogic\Tickets\Attachment;
|
||||
use BusinessLogic\Tickets\Ticket;
|
||||
|
||||
class PhpMailEmailSender implements EmailSender {
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmail() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $ticket Ticket
|
||||
* @param $attachments Attachment[]
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmailWithTicket($emailBuilder, $ticket, $attachments, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmailWithTicket() method.
|
||||
}
|
||||
}
|
29
api/BusinessLogic/Emails/StmpEmailSender.php
Normal file
29
api/BusinessLogic/Emails/StmpEmailSender.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace BusinessLogic\Emails;
|
||||
|
||||
|
||||
use BusinessLogic\Tickets\Attachment;
|
||||
use BusinessLogic\Tickets\Ticket;
|
||||
|
||||
class StmpEmailSender implements EmailSender {
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmail($emailBuilder, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmail() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $emailBuilder EmailBuilder
|
||||
* @param $ticket Ticket
|
||||
* @param $attachments Attachment[]
|
||||
* @param $heskSettings array
|
||||
* @param $modsForHeskSettings array
|
||||
*/
|
||||
function sendEmailWithTicket($emailBuilder, $ticket, $attachments, $heskSettings, $modsForHeskSettings) {
|
||||
// TODO: Implement sendEmailWithTicket() method.
|
||||
}
|
||||
}
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 1/27/2017
|
||||
* Time: 9:25 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Security;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 1/27/2017
|
||||
* Time: 9:51 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Security;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: user
|
||||
* Date: 1/19/17
|
||||
* Time: 8:51 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Security;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: user
|
||||
* Date: 1/19/17
|
||||
* Time: 8:49 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Security;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/15/2017
|
||||
* Time: 9:52 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Statuses;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/15/2017
|
||||
* Time: 9:46 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Statuses;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/16/2017
|
||||
* Time: 8:53 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Statuses;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 1/31/2017
|
||||
* Time: 9:31 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/12/2017
|
||||
* Time: 4:54 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cokoch
|
||||
* Date: 2/9/2017
|
||||
* Time: 12:28 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets\CustomFields;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cokoch
|
||||
* Date: 2/13/2017
|
||||
* Time: 12:03 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 1/31/2017
|
||||
* Time: 10:13 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/6/2017
|
||||
* Time: 9:20 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/13/2017
|
||||
* Time: 9:21 PM
|
||||
*/
|
||||
|
||||
namespace Controllers;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cokoch
|
||||
* Date: 2/10/2017
|
||||
* Time: 12:53 PM
|
||||
*/
|
||||
|
||||
namespace Core\Constants;
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace DataAccess\Statuses;
|
||||
|
||||
|
||||
use BusinessLogic\Statuses\DefaultStatusForAction;
|
||||
use BusinessLogic\Statuses\Status;
|
||||
use DataAccess\CommonDao;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/2/2017
|
||||
* Time: 9:57 PM
|
||||
*/
|
||||
|
||||
namespace Tests;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: cokoch
|
||||
* Date: 2/9/2017
|
||||
* Time: 12:29 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets\CustomFields;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/4/2017
|
||||
* Time: 9:32 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets\TicketCreatorTests;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Mike
|
||||
* Date: 2/12/2017
|
||||
* Time: 12:52 AM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets\TicketCreatorTests;
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: mkoch
|
||||
* Date: 2/11/2017
|
||||
* Time: 4:32 PM
|
||||
*/
|
||||
|
||||
namespace BusinessLogic\Tickets;
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"phpunit/phpunit": "5.7.9"
|
||||
"phpunit/phpunit": "5.7.9",
|
||||
"phpmailer/phpmailer": "^5.2"
|
||||
}
|
||||
}
|
||||
|
62
api/composer.lock
generated
62
api/composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "63ae3f15414ec2f99c94a87db755a1af",
|
||||
"content-hash": "daddd21e73d89f981995c60d0188767d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
@ -248,6 +248,66 @@
|
||||
],
|
||||
"time": "2016-11-25T06:54:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v5.2.22",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/b18cb98131bd83103ccb26a888fdfe3177b8a663",
|
||||
"reference": "b18cb98131bd83103ccb26a888fdfe3177b8a663",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpdocumentor/phpdocumentor": "*",
|
||||
"phpunit/phpunit": "4.7.*"
|
||||
},
|
||||
"suggest": {
|
||||
"league/oauth2-google": "Needed for Google XOAUTH2 authentication"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"class.phpmailer.php",
|
||||
"class.phpmaileroauth.php",
|
||||
"class.phpmaileroauthgoogle.php",
|
||||
"class.smtp.php",
|
||||
"class.pop3.php",
|
||||
"extras/EasyPeasyICS.php",
|
||||
"extras/ntlm_sasl_client.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"LGPL-2.1"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jim Jagielski",
|
||||
"email": "jimjag@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Marcus Bointon",
|
||||
"email": "phpmailer@synchromedia.co.uk"
|
||||
},
|
||||
{
|
||||
"name": "Andy Prevost",
|
||||
"email": "codeworxtech@users.sourceforge.net"
|
||||
},
|
||||
{
|
||||
"name": "Brent R. Matzelle"
|
||||
}
|
||||
],
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"time": "2017-01-09T09:33:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpspec/prophecy",
|
||||
"version": "dev-master",
|
||||
|
Loading…
x
Reference in New Issue
Block a user