1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00
invoiceninja/app/Mail/ContactPasswordlessLogin.php

63 lines
1.4 KiB
PHP
Raw Normal View History

2021-03-31 18:10:44 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Mail;
2021-06-03 01:50:31 +02:00
use App\Models\Company;
2021-03-31 18:10:44 +02:00
use App\Utils\ClientPortal\MagicLink;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class ContactPasswordlessLogin extends Mailable
{
2021-06-09 17:07:41 +02:00
/** @var string */
2021-03-31 18:10:44 +02:00
public $email;
2021-06-09 17:07:41 +02:00
/** @var string */
2021-06-02 13:04:50 +02:00
public $url;
2021-06-03 01:50:31 +02:00
2021-06-09 17:07:41 +02:00
/** @var Company */
public $company;
2021-03-31 18:10:44 +02:00
/**
* Create a new message instance.
*
* @param string $email
* @param string $redirect
*/
2021-06-09 17:07:41 +02:00
public function __construct(string $email, Company $company, string $redirect = '')
2021-03-31 18:10:44 +02:00
{
$this->email = $email;
2021-06-09 17:07:41 +02:00
$this->company = $company;
$this->url = MagicLink::create($email, $company->id, $redirect);
2021-03-31 18:10:44 +02:00
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this
->subject(ctrans('texts.account_passwordless_login'))
2021-06-09 17:07:41 +02:00
->view('email.billing.passwordless-login', [
'logo' => $this->company->present()->logo(),
'settings' => $this->company->settings,
]);
2021-03-31 18:10:44 +02:00
}
}