53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Http\Request;
|
|
|
|
class Otorisasi extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
protected $request;
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(Request $request)
|
|
{
|
|
$this->request = $request;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function build()
|
|
{
|
|
$config = config('beautymail.view');
|
|
if(array_key_exists('logo',$config)){
|
|
$config['logo']['path'] = preg_replace("/\%PUBLIC\%/",env('APP_URL'),$config['logo']['path']);
|
|
}
|
|
|
|
$no_telepon = sprintf("%s%s%s",
|
|
substr($this->request->input('no_telepon'), 0, 4),
|
|
str_repeat('*',4),
|
|
substr($this->request->input('no_telepon'), (strlen($this->request->input('no_telepon'))-4) ) );
|
|
|
|
return $this->view('emails.otorisasi')
|
|
->with(array_merge($config,[
|
|
'nama' => $this->request->input('nama'),
|
|
'no_telepon' => $no_telepon,
|
|
'pin_author' => $this->request->input('pin'),
|
|
'senderName' => env('MAIL_FROM_NAME','SIMRS')
|
|
]))
|
|
->subject('Kode Pin Otorisasi SIMRS');
|
|
}
|
|
}
|