1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Mail/ContactPasswordlessLogin.php

57 lines
1.2 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
{
/**
* @var string
*/
public $email;
2021-06-02 13:04:50 +02:00
public $url;
2021-06-03 01:50:31 +02:00
2021-03-31 18:10:44 +02:00
/**
* Create a new message instance.
*
* @param string $email
* @param string $redirect
*/
2021-06-03 01:50:31 +02:00
public function __construct(string $email, $company_id, string $redirect = '')
2021-03-31 18:10:44 +02:00
{
$this->email = $email;
2021-06-03 01:50:31 +02:00
$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'))
->view('email.billing.passwordless-login');
2021-03-31 18:10:44 +02:00
}
}