Updated bookable rooms emails
Change-Id: I799ea6c130d54e0172b93c88282a1ee3541319b4
This commit is contained in:
parent
4203b47250
commit
835f32ea2a
@ -14,7 +14,6 @@
|
|||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Mail\Mailable;
|
use Illuminate\Mail\Mailable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use models\summit\SummitRoomReservation;
|
use models\summit\SummitRoomReservation;
|
||||||
/**
|
/**
|
||||||
* Class AbstractBookableRoomReservationEmailextends
|
* Class AbstractBookableRoomReservationEmailextends
|
||||||
@ -25,18 +24,83 @@ abstract class AbstractBookableRoomReservationEmail extends Mailable
|
|||||||
use Queueable, SerializesModels;
|
use Queueable, SerializesModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SummitRoomReservation
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $reservation;
|
public $owner_fullname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractBookableRoomReservationEmailextends constructor.
|
* @var string
|
||||||
|
*/
|
||||||
|
public $owner_email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $room_complete_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $room_capacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $reservation_start_datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $reservation_end_datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $reservation_created_datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $reservation_amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $reservation_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $reservation_refunded_amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $reservation_currency;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $summit_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AbstractBookableRoomReservationEmail constructor.
|
||||||
* @param SummitRoomReservation $reservation
|
* @param SummitRoomReservation $reservation
|
||||||
*/
|
*/
|
||||||
public function __construct(SummitRoomReservation $reservation)
|
public function __construct(SummitRoomReservation $reservation)
|
||||||
{
|
{
|
||||||
$this->reservation = $reservation;
|
$this->owner_fullname = $reservation->getOwner()->getFullName();
|
||||||
|
$this->owner_email = $reservation->getOwner()->getEmail();
|
||||||
|
$this->room_complete_name = $reservation->getRoom()->getCompleteName();
|
||||||
|
$this->reservation_start_datetime = $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s");
|
||||||
|
$this->reservation_end_datetime = $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s");
|
||||||
|
$this->reservation_created_datetime = $reservation->getCreated()->format("Y-m-d H:i:s");
|
||||||
|
$this->reservation_amount = $reservation->getAmount();
|
||||||
|
$this->reservation_currency = $reservation->getCurrency();
|
||||||
|
$this->reservation_id = $reservation->getId();
|
||||||
|
$this->room_capacity = $reservation->getRoom()->getCapacity();
|
||||||
|
$this->summit_name = $reservation->getRoom()->getSummit()->getName();
|
||||||
|
$this->reservation_refunded_amount = $reservation->getRefundedAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ use Illuminate\Support\Facades\Config;
|
|||||||
*/
|
*/
|
||||||
final class BookableRoomReservationCanceledEmail extends AbstractBookableRoomReservationEmail
|
final class BookableRoomReservationCanceledEmail extends AbstractBookableRoomReservationEmail
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the message.
|
* Build the message.
|
||||||
*
|
*
|
||||||
@ -25,12 +27,13 @@ final class BookableRoomReservationCanceledEmail extends AbstractBookableRoomRes
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$subject = Config::get("mail.bookable_room_reservation_canceled_email_subject");
|
$subject = sprintf("[%s] Your Room Reservation had been canceled", $this->summit_name);
|
||||||
if(empty($subject))
|
$from = Config::get("mail.from");
|
||||||
$subject = sprintf("[%s] Your Room Reservation had been canceled", Config::get('app.app_name'));
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
return $this->from(Config::get("mail.from"))
|
}
|
||||||
->to($this->reservation->getOwner()->getEmail())
|
return $this->from($from)
|
||||||
|
->to($this->owner_email)
|
||||||
->subject($subject)
|
->subject($subject)
|
||||||
->view('emails.bookable_rooms.reservation_canceled');
|
->view('emails.bookable_rooms.reservation_canceled');
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ use Illuminate\Support\Facades\Config;
|
|||||||
*/
|
*/
|
||||||
final class BookableRoomReservationCreatedEmail extends AbstractBookableRoomReservationEmail
|
final class BookableRoomReservationCreatedEmail extends AbstractBookableRoomReservationEmail
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the message.
|
* Build the message.
|
||||||
*
|
*
|
||||||
@ -25,12 +26,13 @@ final class BookableRoomReservationCreatedEmail extends AbstractBookableRoomRese
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$subject = Config::get("mail.bookable_room_reservation_created_email_subject");
|
$subject = sprintf("[%s] Room Reservation Created", $this->summit_name);
|
||||||
if(empty($subject))
|
$from = Config::get("mail.from");
|
||||||
$subject = sprintf("[%s] Room Reservation Created", Config::get('app.app_name'));
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
return $this->from(Config::get("mail.from"))
|
}
|
||||||
->to($this->reservation->getOwner()->getEmail())
|
return $this->from($from)
|
||||||
|
->to($this->owner_email)
|
||||||
->subject($subject)
|
->subject($subject)
|
||||||
->view('emails.bookable_rooms.reservation_created');
|
->view('emails.bookable_rooms.reservation_created');
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,13 @@ final class BookableRoomReservationPaymentConfirmedEmail extends AbstractBookabl
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$subject = Config::get("mail.bookable_room_reservation_payment_confirmed_email_subject");
|
$subject = sprintf("[%s] Your Room Reservation is confirmed!", $this->summit_name);
|
||||||
if(empty($subject))
|
$from = Config::get("mail.from");
|
||||||
$subject = sprintf("[%s] Your Room Reservation is confirmed!", Config::get('app.app_name'));
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
return $this->from(Config::get("mail.from"))
|
}
|
||||||
->to($this->reservation->getOwner()->getEmail())
|
return $this->from($from)
|
||||||
|
->to($this->owner_email)
|
||||||
->subject($subject)
|
->subject($subject)
|
||||||
->view('emails.bookable_rooms.reservation_payment_confirmed');
|
->view('emails.bookable_rooms.reservation_payment_confirmed');
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,13 @@ final class BookableRoomReservationRefundAcceptedEmail extends AbstractBookableR
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$subject = Config::get("mail.bookable_room_reservation_refund_accepted_email_subject");
|
$subject = sprintf("[%s] Your Room Reservation Refund is Accepted!", $this->summit_name);
|
||||||
if(empty($subject))
|
$from = Config::get("mail.from");
|
||||||
$subject = sprintf("[%s] Your Room Reservation Refund is Accepted!", Config::get('app.app_name'));
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
return $this->from(Config::get("mail.from"))
|
}
|
||||||
->to($this->reservation->getOwner()->getEmail())
|
return $this->from($from)
|
||||||
|
->to($this->owner_email)
|
||||||
->subject($subject)
|
->subject($subject)
|
||||||
->view('emails.bookable_rooms.reservation_refund_accepted');
|
->view('emails.bookable_rooms.reservation_refund_accepted');
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,12 @@ final class BookableRoomReservationRefundRequestedAdminEmail extends AbstractBoo
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
$subject = Config::get("mail.bookable_room_reservation_refund_requeted_admin_email_subject");
|
$subject = sprintf("[%s] There is a new reservation refund request available!", $this->summit_name);
|
||||||
if(empty($subject))
|
$from = Config::get("mail.from");
|
||||||
$subject = sprintf("[%s] There is a new reservation refund request available!", Config::get('app.app_name'));
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
return $this->from(Config::get("mail.from"))
|
}
|
||||||
|
return $this->from($from)
|
||||||
->to(Config::get("bookable_rooms.admin_email"))
|
->to(Config::get("bookable_rooms.admin_email"))
|
||||||
->subject($subject)
|
->subject($subject)
|
||||||
->view('emails.bookable_rooms.reservation_refund_requested_admin');
|
->view('emails.bookable_rooms.reservation_refund_requested_admin');
|
||||||
|
@ -25,6 +25,15 @@ final class BookableRoomReservationRefundRequestedOwnerEmail extends AbstractBoo
|
|||||||
*/
|
*/
|
||||||
public function build()
|
public function build()
|
||||||
{
|
{
|
||||||
return $this->view('view.name');
|
|
||||||
|
$subject = sprintf("[%s] Your Room Reservation Refund is requested!", $this->summit_name);
|
||||||
|
$from = Config::get("mail.from");
|
||||||
|
if(empty($from)){
|
||||||
|
throw new \InvalidArgumentException("mail.from is not set");
|
||||||
|
}
|
||||||
|
return $this->from($from)
|
||||||
|
->to($this->owner_email)
|
||||||
|
->subject($subject)
|
||||||
|
->view('emails.bookable_rooms.reservation_refund_requested_owner');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,20 +5,21 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Dear {!! $reservation->getOwner()->getFullName() !!},
|
Dear {!! $owner_fullname !!}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Your Reservation for room {!! $reservation->getRoom()->getCompleteName() !!} got canceled because you did not take any action to pay it.
|
Your Reservation for room {!! $room_complete_name !!} got canceled because you did not take any action to pay it.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Id {!! $reservation->getId()!!}
|
<ul>
|
||||||
Owner {!! $reservation->getOwner()->getFullName()!!}
|
<li>Id {!! $reservation_id !!}</li>
|
||||||
Email {!! $reservation->getOwner()->getEmail()!!}
|
<li>Owner {!! $owner_fullname!!}</li>
|
||||||
From {!! $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s") !!}
|
<li>Email {!! $owner_email!!}</li>
|
||||||
To {!! $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s") !!}
|
<li>From {!! $reservation_start_datetime !!}</li>
|
||||||
Created {!! $reservation->getCreated()->format("Y-m-d H:i:s") !!}
|
<li>To {!! $reservation_end_datetime !!}</li>
|
||||||
Amount {!! $reservation->getAmount() !!}
|
<li>Created {!!$reservation_created_datetime !!}</li>
|
||||||
Currency {!! $reservation->getCurrency() !!}
|
<li>Amount {!! $reservation_currency !!} {!! $reservation_amount !!}</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Dear {!! $reservation->getOwner()->getFullName() !!},
|
Dear {!! $owner_fullname !!}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Your Reservation for room {!! $reservation->getRoom()->getCompleteName() !!} has been created successfully.
|
Your Reservation for room {!! $room_complete_name !!} has been created successfully.
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,20 +5,22 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Dear {!! $reservation->getOwner()->getFullName() !!},
|
Dear {!! $owner_fullname !!}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Your Reservation for room {!! $reservation->getRoom()->getCompleteName() !!} has been confirmed.
|
Your Reservation for room {!! $room_complete_name !!} has been confirmed.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Please take note of the reservation info bellow:
|
Please take note of the reservation info bellow:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
From {!! $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s") !!}
|
<ul>
|
||||||
To {!! $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s") !!}
|
<li>{!! $room_complete_name !!}</li>
|
||||||
Room Capacity {!! $reservation->getRoom()->getCapacity() !!}
|
<li>From {!! $reservation_start_datetime !!}</li>
|
||||||
Amount {!! $reservation->getAmount() !!}
|
<li>To {!! $reservation_end_datetime !!}</li>
|
||||||
Currency {!! $reservation->getCurrency() !!}
|
<li>Room Capacity {!! $room_capacity !!}</li>
|
||||||
|
<li>Amount {!! $reservation_currency !!} {!! $reservation_amount !!}</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,20 +5,22 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Dear {!! $reservation->getOwner()->getFullName() !!},
|
Dear {!! $owner_fullname!!}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Your Refund Request Reservation for room {!! $reservation->getRoom()->getCompleteName() !!} has been confirmed.
|
Your Refund Request Reservation for room {!! $room_complete_name !!} is confirmed.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Please take note of the reservation info bellow:
|
Please take note of the reservation info below:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
From {!! $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s") !!}
|
<ul>
|
||||||
To {!! $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s") !!}
|
<li>{!! $room_complete_name !!}</li>
|
||||||
Room Capacity {!! $reservation->getRoom()->getCapacity() !!}
|
<li>From {!! $reservation_start_datetime !!}</li>
|
||||||
Amount {!! $reservation->getRefundedAmount() !!}
|
<li>To {!! $reservation_end_datetime !!}</li>
|
||||||
Currency {!! $reservation->getCurrency() !!}
|
<li>Room Capacity {!! $room_capacity !!}</li>
|
||||||
|
<li>Amount {!! $reservation_currency !!} {!! $reservation_refunded_amount !!}</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
@ -8,17 +8,19 @@
|
|||||||
There is a new reservation refund request available to process
|
There is a new reservation refund request available to process
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Please take note of the reservation info bellow:
|
Please take note of the reservation info below:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Id {!! $reservation->getId()!!}
|
<ul>
|
||||||
Owner {!! $reservation->getOwner()->getFullName()!!}
|
<li>Id {!! $reservation_id!!}</li>
|
||||||
Email {!! $reservation->getOwner()->getEmail()!!}
|
<li>{!! $room_complete_name !!}</li>
|
||||||
From {!! $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s") !!}
|
<li>Owner {!! $owner_fullname!!}</li>
|
||||||
To {!! $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s") !!}
|
<li>Email {!! $owner_email !!}</li>
|
||||||
Created {!! $reservation->getCreated()->format("Y-m-d H:i:s") !!}
|
<li>From {!! $reservation_start_datetime !!}</li>
|
||||||
Amount {!! $reservation->getAmount() !!}
|
<li>To {!! $reservation_end_datetime !!}</li>
|
||||||
Currency {!! $reservation->getCurrency() !!}
|
<li>Created {!! $reservation_created_datetime !!}</li>
|
||||||
|
<li>Amount {!! $reservation_currency !!} {!! $reservation_amount !!}</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,23 +5,24 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Dear {!! $reservation->getOwner()->getFullName() !!},
|
Dear {!! $owner_fullname !!}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You had requested a refund for your reservation.
|
You had requested a refund for your reservation.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Please take note of the reservation info bellow:
|
Please take note of the reservation info below:
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Id {!! $reservation->getId()!!}
|
<ul>
|
||||||
Owner {!! $reservation->getOwner()->getFullName()!!}
|
<li>Id {!! $reservation_id!!}</li>
|
||||||
Email {!! $reservation->getOwner()->getEmail()!!}
|
<li>Owner {!! $owner_fullname!!}</li>
|
||||||
From {!! $reservation->getLocalStartDatetime()->format("Y-m-d H:i:s") !!}
|
<li>Email {!! $owner_email!!}</li>
|
||||||
To {!! $reservation->getLocalEndDatetime()->format("Y-m-d H:i:s") !!}
|
<li>From {!! $reservation_start_datetime !!}</li>
|
||||||
Created {!! $reservation->getCreated()->format("Y-m-d H:i:s") !!}
|
<li>To {!! $reservation_end_datetime !!}</li>
|
||||||
Amount {!! $reservation->getAmount() !!}
|
<li>Created {!! $reservation_created_datetime !!}</li>
|
||||||
Currency {!! $reservation->getCurrency() !!}
|
<li>Amount {!! $reservation_currency !!} {!! $reservation_amount !!}</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
<p>Cheers,<br/>{!! Config::get('app.tenant_name') !!} Support Team</p>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user