1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Mail/Admin/VerifyUserObject.php
2021-02-14 22:36:36 +11:00

58 lines
1.4 KiB
PHP

<?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\Admin;
use App\Utils\Traits\MakesHash;
class VerifyUserObject
{
use MakesHash;
public $user;
public $company;
/**
*
*/
public function __construct($user, $company)
{
$this->user = $user;
$this->company = $company;
}
public function build()
{
$this->user->confirmation_code = $this->createDbHash($this->company->db);
$this->user->save();
$data = [
'title' => ctrans('texts.confirmation_subject'),
'message' => ctrans('texts.confirmation_message'),
'url' => url("/user/confirm/{$this->user->confirmation_code}"),
'button' => ctrans('texts.button_confirmation_message'),
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
'signature' => $this->company->settings->email_signature,
];
$mail_obj = new \stdClass;
$mail_obj->subject = ctrans('texts.confirmation_subject');
$mail_obj->data = $data;
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
return $mail_obj;
}
}