app/Mail/ContactPasswordlessLogin.php

This commit is contained in:
Benjamin Beganović 2021-06-09 17:07:41 +02:00
parent 40f22e7839
commit 15acba27dd
4 changed files with 23 additions and 23 deletions

View File

@ -451,7 +451,7 @@ class BillingPortalPurchase extends Component
->first();
$mailer = new NinjaMailerObject();
$mailer->mailable = new ContactPasswordlessLogin($this->email, $this->subscription->company->id, (string)route('client.subscription.purchase', $this->subscription->hashed_id) . '?coupon=' . $this->coupon);
$mailer->mailable = new ContactPasswordlessLogin($this->email, $this->subscription->company, (string)route('client.subscription.purchase', $this->subscription->hashed_id) . '?coupon=' . $this->coupon);
$mailer->company = $this->subscription->company;
$mailer->settings = $this->subscription->company->settings;
$mailer->to_user = $contact;

View File

@ -21,25 +21,28 @@ use Illuminate\Queue\SerializesModels;
class ContactPasswordlessLogin extends Mailable
{
/**
* @var string
*/
/** @var string */
public $email;
/** @var string */
public $url;
/** @var Company */
public $company;
/**
* Create a new message instance.
*
* @param string $email
* @param string $redirect
*/
public function __construct(string $email, $company_id, string $redirect = '')
public function __construct(string $email, Company $company, string $redirect = '')
{
$this->email = $email;
$this->url = MagicLink::create($email, $company_id, $redirect);
$this->company = $company;
$this->url = MagicLink::create($email, $company->id, $redirect);
}
/**
@ -51,6 +54,9 @@ class ContactPasswordlessLogin extends Mailable
{
return $this
->subject(ctrans('texts.account_passwordless_login'))
->view('email.billing.passwordless-login');
->view('email.billing.passwordless-login', [
'logo' => $this->company->present()->logo(),
'settings' => $this->company->settings,
]);
}
}

View File

@ -4255,7 +4255,9 @@ $LANG = array(
'user_duplicate_error' => 'Cannot add the same user to the same company',
'user_cross_linked_error' => 'User exists but cannot be crossed linked to multiple accounts',
'ach_verification_notification_label' => 'ACH verification',
'ach_verification_notification' => 'Connecting bank accounts require verification. Stripe will automatically sends two small deposits for this purpose. These deposits take 1-2 business days to appear on the customer\'s online statement.'
'ach_verification_notification' => 'Connecting bank accounts require verification. Stripe will automatically sends two small deposits for this purpose. These deposits take 1-2 business days to appear on the customer\'s online statement.',
'login_link_requested_label' => 'Login link requested',
'login_link_requested' => 'There was a request to login using link. If you did not request this, it\'s safe to ignore it.',
);
return $LANG;

View File

@ -1,16 +1,8 @@
@component('email.template.master', ['design' => 'light'])
@slot('header')
@include('email.components.header', ['logo' => 'https://www.invoiceninja.com/wp-content/uploads/2015/10/logo-white-horizontal-1.png'])
@endslot
<h2>Login link requested</h2>
<p>Hey, there was a request to log in using link.</p>
@component('email.template.admin', ['logo' => $logo, 'settings' => $settings])
<div class="center">
<h1>{{ ctrans('texts.login_link_requested_label') }}</h1>
<p>{{ ctrans('texts.login_link_requested') }}</p>
<a href="{{ $url }}" target="_blank" class="button">Sign in to Invoice Ninja</a>
<span style="margin-top: 35px; display: block;">Link above is only for you. Don't share it anyone.</span>
<span>If you didn't request this, just ignore it.</span>
<span style="margin-top: 25px; display: block;">If you can't click on the button, copy following link:</span>
<a href="{{ $url }}">{{ $url }}</a>
</div>
@endcomponent