forked from point-red/point
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd82180
commit 12c7065
Showing
4 changed files
with
144 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
app/Mail/Plugin/PlayBook/Approval/InstructionApprovalRequestSent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace App\Mail\Plugin\PlayBook\Approval; | ||
|
||
use App\Model\Plugin\PlayBook\Instruction; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class InstructionApprovalRequestSent extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
public $instruction; | ||
public $approver; | ||
public $urlReferer; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(Instruction $instruction, $approver, $urlReferer) | ||
{ | ||
$this->instruction = $instruction; | ||
$this->approver = $approver; | ||
$this->urlReferer = $urlReferer; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
if (@$this->urlReferer) { | ||
$parsedUrl = parse_url($this->urlReferer); | ||
$port = @$parsedUrl['port'] ? ":{$parsedUrl['port']}" : ''; | ||
$url = "{$parsedUrl['scheme']}://{$parsedUrl['host']}{$port}/plugin/play-book/approval/instruction"; | ||
} | ||
|
||
return $this->subject("New Instruction") | ||
->view('emails.plugin.play-book.instruction-approval-sent', [ | ||
'instruction' => $this->instruction, | ||
'name' => $this->approver->name, | ||
'url' => @$url, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters