| 1 |
<?php |
| 2 |
/** |
| 3 |
* New event email class |
| 4 |
* |
| 5 |
* @package Timetics |
| 6 |
*/ |
| 7 |
namespace Timetics\Core\Emails; |
| 8 |
|
| 9 |
use Timetics\Core\Appointments\Appointment; |
| 10 |
use Timetics\Core\Bookings\Booking; |
| 11 |
use Timetics\Core\Customers\Customer; |
| 12 |
use Timetics\Core\Staffs\Staff; |
| 13 |
|
| 14 |
class New_Event_Email extends Email { |
| 15 |
|
| 16 |
/** |
| 17 |
* Store booking object |
| 18 |
* |
| 19 |
* @var Object |
| 20 |
*/ |
| 21 |
public $booking; |
| 22 |
|
| 23 |
/** |
| 24 |
* Store staff object |
| 25 |
* |
| 26 |
* @var Object |
| 27 |
*/ |
| 28 |
public $staff; |
| 29 |
|
| 30 |
/** |
| 31 |
* Store customer object |
| 32 |
* |
| 33 |
* @var Object |
| 34 |
*/ |
| 35 |
public $customer; |
| 36 |
|
| 37 |
/** |
| 38 |
* Store meeting object |
| 39 |
* |
| 40 |
* @var Object |
| 41 |
*/ |
| 42 |
public $meeting; |
| 43 |
|
| 44 |
/** |
| 45 |
* New Event Email Constructor |
| 46 |
* |
| 47 |
* @return void |
| 48 |
*/ |
| 49 |
public function __construct( Booking $booking ) { |
| 50 |
$this->booking = $booking; |
| 51 |
$this->meeting = new Appointment( $booking->get_appointment() ); |
| 52 |
$this->staff = new Staff( $booking->get_staff_id() ); |
| 53 |
$this->customer = new Customer( $booking->get_customer_id() ); |
| 54 |
|
| 55 |
parent::__construct(); |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Get email recipient |
| 60 |
* |
| 61 |
* @return string |
| 62 |
*/ |
| 63 |
public function get_recipient() { |
| 64 |
return $this->staff->get_email(); |
| 65 |
} |
| 66 |
|
| 67 |
/** |
| 68 |
* Get new event email |
| 69 |
* |
| 70 |
* @return string |
| 71 |
*/ |
| 72 |
public function get_subject() { |
| 73 |
return $this->meeting->get_name(); |
| 74 |
} |
| 75 |
|
| 76 |
/** |
| 77 |
* Get email title |
| 78 |
* |
| 79 |
* @return string |
| 80 |
*/ |
| 81 |
public function get_title() { |
| 82 |
return $this->meeting->get_name(); |
| 83 |
} |
| 84 |
|
| 85 |
/** |
| 86 |
* Get template new event email |
| 87 |
* |
| 88 |
* @return string |
| 89 |
*/ |
| 90 |
public function get_template() { |
| 91 |
return TIMETICS_PLUGIN_DIR . '/templates/emails/new-event.php'; |
| 92 |
} |
| 93 |
} |
| 94 |
|