1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 16:13:20 +01:00
invoiceninja/app/Mail/RecurringInvoice/ClientContactRequestCancellationObject.php

62 lines
1.9 KiB
PHP
Raw Normal View History

2021-02-14 21:55:09 +01: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)
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2021-02-14 21:55:09 +01:00
*/
namespace App\Mail\RecurringInvoice;
2021-06-29 11:46:40 +02:00
use App\Utils\Ninja;
use Illuminate\Support\Facades\App;
2021-02-14 21:55:09 +01:00
class ClientContactRequestCancellationObject
{
public $recurring_invoice;
public $client_contact;
private $company;
2021-02-14 21:55:09 +01:00
/**
*
*/
public function __construct($recurring_invoice, $client_contact)
{
$this->recurring_invoice = $recurring_invoice;
$this->client_contact = $client_contact;
$this->company = $recurring_invoice->company;
2021-02-14 21:55:09 +01:00
}
public function build()
{
2021-06-29 11:46:40 +02:00
App::forgetInstance('translator');
$t = app('translator');
$t->replace(Ninja::transformTranslations($this->company->settings));
2021-02-14 21:55:09 +01:00
$data = [
'title' => ctrans('texts.recurring_cancellation_request', ['contact' => $this->client_contact->present()->name()]),
'content' => ctrans('texts.recurring_cancellation_request_body', ['contact' => $this->client_contact->present()->name(), 'client' => $this->client_contact->client->present()->name(), 'invoice' => $this->recurring_invoice->number]),
2021-02-14 21:55:09 +01:00
'url' => config('ninja.web_url'),
'button' => ctrans('texts.account_login'),
'signature' => $this->company->settings->email_signature,
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
];
$mail_obj = new \stdClass;
2021-02-14 22:32:59 +01:00
$mail_obj->subject = ctrans('texts.recurring_cancellation_request', ['contact' => $this->client_contact->present()->name()]);
2021-02-14 21:55:09 +01:00
$mail_obj->data = $data;
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
return $mail_obj;
}
}