Preview: AdminResetPassword.php
Size: 1.93 KB
/var/www/multi-event-cfp.bitkit.dk/httpdocs/app/Mail/AdminResetPassword.php
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class AdminResetPassword extends Mailable
{
use Queueable, SerializesModels;
protected $user;
protected $event;
protected $password;
protected $hasEventSlug;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($user, $event, $password, $hasEventSlug)
{
$this->user = $user;
$this->event = $event;
$this->password = $password;
$this->hasEventSlug = $hasEventSlug;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$logo = config('app.url') . '/' . $this->event->theme['logo']['value'];
$eventHeader = $this->event->event_name;
if ($this->hasEventSlug) {
$body = "
<p>
Hi {$this->user->name},<br/><br/>
Your password has been successfully reset.<br><br>
New Password: {$this->password}<br>
<br>
Thank you,<br>
{$this->event->event_name} Team<br>
</p>";
} else {
$body = "
<p>
Hi {$this->user->name},<br/><br/>
Your password for <b>{$this->event->event_name}</b> has been reset by the {$this->event->event_name} admins.<br><br>
New Password: {$this->password}<br>
<br>
Thank you,<br>
{$this->event->event_name} Team<br>
</p>";
}
return $this->from(config('app.admin_mail', 'Admin'), $this->event->event_name)
->subject("Password reset")
->view('emails.user.password_reset')
->with([
"body" => $body,
"logo" => $logo,
"eventHeader" => $eventHeader
]);
}
}
Directory Contents
Dirs: 0 × Files: 34