1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Mail/Ninja/StripeConnectFailed.php

114 lines
3.0 KiB
PHP
Raw Normal View History

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Mail\Ninja;
use App\Models\Company;
2023-10-26 04:57:44 +02:00
use App\Models\User;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
2023-10-26 04:57:44 +02:00
use Illuminate\Mail\Mailables\Headers;
class StripeConnectFailed extends Mailable
{
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(public User $user, public Company $company)
{
}
/**
* Get the message envelope.
*
* @return \Illuminate\Mail\Mailables\Envelope
*/
public function envelope()
{
return new Envelope(
subject: "Stripe Connect not configured, please login and connect.",
2023-11-24 00:23:40 +01:00
from: config('ninja.contact.email'),
to: $this->user->email,
);
}
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content()
{
2024-01-14 05:05:00 +01:00
return new Content(
view: 'email.admin.stripe_connect_failed',
text: 'email.admin.stripe_connect_failed_text',
with: [
'text_body' => $this->textBody(), //@todo this is a bit hacky here.
'body' => $this->htmlBody(),
'title' => 'Connect your Stripe account',
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
'signature' => '',
'company' => $this->company,
'greeting' => '',
'links' => [],
'url' => 'https://www.loom.com/share/a3dc3131cc924e14a34634d5d48065c8?sid=b1971aa2-9deb-4339-8ebd-53f9947ef633',
'button' => "texts.view"
]
);
}
private function textBody()
{
return "
We note you are yet to connect your Stripe account to Invoice Ninja. Please log in to Invoice Ninja and connect your Stripe account.\n\n
Once logged in you can use the following resource to connect your Stripe account: \n\n
";
}
private function htmlBody()
{
return "
We note you are yet to connect your Stripe account to Invoice Ninja. Please log in to Invoice Ninja and connect your Stripe account.<br><br>
Once logged in you can use the following resource to connect your Stripe account: <br><br>
";
}
/**
* Get the attachments for the message.
*
* @return array
*/
public function attachments()
{
return [];
}
2024-01-14 05:05:00 +01:00
/**
* Get the message headers.
*
* @return \Illuminate\Mail\Mailables\Headers
*/
public function headers()
{
return new Headers(
messageId: null,
references: [],
text:['' => ''],
);
}
}