diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index 5eb773a6ebc7..ae48db25534c 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -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; diff --git a/app/Mail/ContactPasswordlessLogin.php b/app/Mail/ContactPasswordlessLogin.php index 4f70993936fd..aa4a03554c0d 100644 --- a/app/Mail/ContactPasswordlessLogin.php +++ b/app/Mail/ContactPasswordlessLogin.php @@ -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, + ]); } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 69c9a65459c4..14cf69852ddb 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -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; diff --git a/resources/views/email/billing/passwordless-login.blade.php b/resources/views/email/billing/passwordless-login.blade.php index de25c0aed036..43695a043d98 100644 --- a/resources/views/email/billing/passwordless-login.blade.php +++ b/resources/views/email/billing/passwordless-login.blade.php @@ -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 +@component('email.template.admin', ['logo' => $logo, 'settings' => $settings]) +
{{ ctrans('texts.login_link_requested') }}
-Hey, there was a request to log in using link.
- - Sign in to Invoice Ninja - - Link above is only for you. Don't share it anyone. - If you didn't request this, just ignore it. - - If you can't click on the button, copy following link: - {{ $url }} + Sign in to Invoice Ninja +