diff --git a/VERSION.txt b/VERSION.txt
index 77c57b8949a1..7111a6f69029 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-5.8.17
\ No newline at end of file
+5.8.18
\ No newline at end of file
diff --git a/app/Http/ValidationRules/Company/ValidCompanyQuantity.php b/app/Http/ValidationRules/Company/ValidCompanyQuantity.php
index 75796f03eb97..80211e99ce42 100644
--- a/app/Http/ValidationRules/Company/ValidCompanyQuantity.php
+++ b/app/Http/ValidationRules/Company/ValidCompanyQuantity.php
@@ -34,7 +34,7 @@ class ValidCompanyQuantity implements Rule
return auth()->user()->company()->account->companies->count() < 10;
}
- return auth()->user()->account->isPaid() && auth()->user()->company()->account->companies->count() < 10 ;
+ return (auth()->user()->account->isPaid() || auth()->user()->account->isTrial()) && auth()->user()->company()->account->companies->count() < 10 ;
}
/**
diff --git a/app/Mail/Admin/AccountCreatedObject.php b/app/Mail/Admin/AccountCreatedObject.php
deleted file mode 100644
index a2725d109163..000000000000
--- a/app/Mail/Admin/AccountCreatedObject.php
+++ /dev/null
@@ -1,53 +0,0 @@
-company->getLocale());
- /* Set customized translations _NOW_ */
- $t->replace(Ninja::transformTranslations($this->company->settings));
-
- $data = [
- 'title' => ctrans('texts.new_signup'),
- 'message' => ctrans('texts.new_signup_text', ['user' => $this->user->present()->name(), 'email' => $this->user->email, 'ip' => $this->user->ip]),
- '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();
- $mail_obj->subject = ctrans('texts.new_signup');
- $mail_obj->data = $data;
- $mail_obj->markdown = 'email.admin.generic';
- $mail_obj->tag = $this->company->company_key;
-
- return $mail_obj;
- }
-}
diff --git a/app/Mail/Admin/AutoBillingFailureObject.php b/app/Mail/Admin/AutoBillingFailureObject.php
deleted file mode 100644
index 76ce429d2f29..000000000000
--- a/app/Mail/Admin/AutoBillingFailureObject.php
+++ /dev/null
@@ -1,115 +0,0 @@
-client = $client;
-
- $this->error = $error;
-
- $this->company = $company;
-
- $this->payment_hash = $payment_hash;
-
- $this->company = $company;
- }
-
- public function build()
- {
- App::forgetInstance('translator');
- /* Init a new copy of the translator*/
- $t = app('translator');
- /* Set the locale*/
- App::setLocale($this->company->getLocale());
- /* Set customized translations _NOW_ */
- $t->replace(Ninja::transformTranslations($this->company->settings));
-
- $this->invoices = Invoice::query()->whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get();
-
- $mail_obj = new stdClass();
- $mail_obj->amount = $this->getAmount();
- $mail_obj->subject = $this->getSubject();
- $mail_obj->data = $this->getData();
- $mail_obj->markdown = 'email.admin.generic';
- $mail_obj->tag = $this->company->company_key;
-
- return $mail_obj;
- }
-
- private function getAmount()
- {
- return array_sum(array_column($this->payment_hash->invoices(), 'amount')) + $this->payment_hash->fee_total;
- }
-
- private function getSubject()
- {
- return
- ctrans(
- 'texts.auto_bill_failed',
- ['invoice_number' => $this->invoices->first()->number]
- );
- }
-
- private function getData()
- {
- $signature = $this->client->getSetting('email_signature');
- $html_variables = (new HtmlEngine($this->invoices->first()->invitations->first()))->makeValues();
- $signature = str_replace(array_keys($html_variables), array_values($html_variables), $signature);
-
- $data = [
- 'title' => ctrans(
- 'texts.auto_bill_failed',
- ['invoice_number' => $this->invoices->first()->number]
- ),
- 'message' => $this->error,
- 'signature' => $signature,
- 'logo' => $this->company->present()->logo(),
- 'settings' => $this->client->getMergedSettings(),
- 'whitelabel' => $this->company->account->isPaid() ? true : false,
- 'url' => config('ninja.app_url'),
- 'button' => ctrans('texts.login'),
- ];
-
- return $data;
- }
-}
diff --git a/app/Mail/Admin/ClientPaymentFailureObject.php b/app/Mail/Admin/ClientPaymentFailureObject.php
index 0fe6ff61bc30..3a9da492f8b0 100644
--- a/app/Mail/Admin/ClientPaymentFailureObject.php
+++ b/app/Mail/Admin/ClientPaymentFailureObject.php
@@ -127,11 +127,6 @@ class ClientPaymentFailureObject
'additional_info' => $this->error ?? '',
];
- if (strlen($this->error > 1)) {
- // $data['content'] .= "\n\n{$this->error}";
- $data['text_body'] .= "\n\n".$this->error;
- }
-
return $data;
}
}
diff --git a/app/Mail/Admin/EntityCreatedObject.php b/app/Mail/Admin/EntityCreatedObject.php
index 63a1c7f6ae8a..c58108013652 100644
--- a/app/Mail/Admin/EntityCreatedObject.php
+++ b/app/Mail/Admin/EntityCreatedObject.php
@@ -73,23 +73,26 @@ class EntityCreatedObject
);
$mail_obj->markdown = 'email.admin.generic';
- // $mail_obj->tag = $this->company->company_key;
- $mail_obj->data = [
- 'title' => $mail_obj->subject,
- 'message' => ctrans(
+
+ $content = ctrans(
$this->template_body,
[
'amount' => $mail_obj->amount,
'vendor' => $this->entity->vendor->present()->name(),
'purchase_order' => $this->entity->number,
]
- ),
+ );
+
+ $mail_obj->data = [
+ 'title' => $mail_obj->subject,
+ 'content' => $content,
'url' => $this->entity->invitations()->first()->getAdminLink($this->use_react_link),
'button' => ctrans("texts.view_{$this->entity_type}"),
'signature' => $this->company->settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $this->company->settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
} else {
$this->entity->load('client.country', 'client.company');
@@ -100,7 +103,7 @@ class EntityCreatedObject
$mail_obj->subject = $this->getSubject();
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
- // $mail_obj->tag = $this->entity->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
}
return $mail_obj;
@@ -165,15 +168,18 @@ class EntityCreatedObject
{
$settings = $this->entity->client->getMergedSettings();
+ $content = $this->getMessage();
+
return [
'title' => $this->getSubject(),
- 'message' => $this->getMessage(),
+ 'content' => $content,
'url' => $this->entity->invitations()->first()->getAdminLink($this->use_react_link),
'button' => ctrans("texts.view_{$this->entity_type}"),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
}
}
diff --git a/app/Mail/Admin/EntityFailedSendObject.php b/app/Mail/Admin/EntityFailedSendObject.php
index 921eedc7f435..53ce0de33500 100644
--- a/app/Mail/Admin/EntityFailedSendObject.php
+++ b/app/Mail/Admin/EntityFailedSendObject.php
@@ -37,11 +37,11 @@ class EntityFailedSendObject
private $template_body;
- private $message;
+ private $message_content;
protected $use_react_url;
- public function __construct($invitation, $entity_type, $template, $message, $use_react_url)
+ public function __construct($invitation, $entity_type, $template, $message_content, $use_react_url)
{
$this->invitation = $invitation;
$this->entity_type = $entity_type;
@@ -49,7 +49,7 @@ class EntityFailedSendObject
$this->contact = $invitation->contact;
$this->company = $invitation->company;
$this->template = $template;
- $this->message = $message;
+ $this->message_content = $message_content;
$this->use_react_url = $use_react_url;
}
@@ -71,6 +71,7 @@ class EntityFailedSendObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -80,36 +81,28 @@ class EntityFailedSendObject
switch ($this->template) {
case 'invoice':
+ case 'reminder1':
+ case 'reminder2':
+ case 'reminder3':
+ case 'reminder_endless':
$this->template_subject = 'texts.notification_invoice_bounced_subject';
$this->template_body = 'texts.notification_invoice_bounced';
break;
- case 'reminder1':
- $this->template_subject = 'texts.notification_invoice_reminder1_sent_subject';
- $this->template_body = 'texts.notification_invoice_sent';
- break;
- case 'reminder2':
- $this->template_subject = 'texts.notification_invoice_reminder2_sent_subject';
- $this->template_body = 'texts.notification_invoice_sent';
- break;
- case 'reminder3':
- $this->template_subject = 'texts.notification_invoice_reminder3_sent_subject';
- $this->template_body = 'texts.notification_invoice_sent';
- break;
- case 'reminder_endless':
- $this->template_subject = 'texts.notification_invoice_reminder_endless_sent_subject';
- $this->template_body = 'texts.notification_invoice_sent';
- break;
case 'quote':
$this->template_subject = 'texts.notification_quote_bounced_subject';
- $this->template_body = 'texts.notification_quote_sent';
+ $this->template_body = 'texts.notification_quote_bounced';
break;
case 'credit':
$this->template_subject = 'texts.notification_credit_bounced_subject';
$this->template_body = 'texts.notification_credit_bounced';
break;
+ case 'purchase_order':
+ $this->template_subject = 'texts.notification_purchase_order_bounced_subject';
+ $this->template_body = 'texts.notification_purchase_order_bounced';
+ break;
default:
- $this->template_subject = 'texts.notification_invoice_sent_subject';
- $this->template_body = 'texts.notification_invoice_sent';
+ $this->template_subject = 'texts.notification_invoice_bounced_subject';
+ $this->template_body = 'texts.notification_invoice_bounced';
break;
}
}
@@ -138,25 +131,30 @@ class EntityFailedSendObject
$html_variables = (new HtmlEngine($this->invitation))->makeValues();
$signature = str_replace(array_keys($html_variables), array_values($html_variables), $signature);
-
- return [
- 'title' => $this->getSubject(),
- 'message' => ctrans(
+ $content = ctrans(
$this->template_body,
[
'amount' => $this->getAmount(),
'client' => $this->contact->present()->name(),
'invoice' => $this->entity->number,
- 'error' => $this->message,
+ 'error' => $this->message_content ?? '',
'contact' => $this->contact->present()->name(),
]
- ),
- 'url' => $this->invitation->getAdminLink($this->use_react_url),
- 'button' => ctrans("texts.view_{$this->entity_type}"),
- 'signature' => $signature,
- 'logo' => $this->company->present()->logo(),
- 'settings' => $settings,
- 'whitelabel' => $this->company->account->isPaid() ? true : false,
+ );
+
+ $data = [
+ "title" => $this->getSubject(),
+ "content" => $content,
+ "url" => $this->invitation->getAdminLink($this->use_react_url),
+ "button" => ctrans("texts.view_{$this->entity_type}"),
+ "signature" => $signature,
+ "logo" => $this->company->present()->logo(),
+ "settings" => $settings,
+ "whitelabel" => $this->company->account->isPaid() ? true : false,
+ "text_body" => str_replace("
", "\n", $content),
];
+
+ return $data;
+
}
}
diff --git a/app/Mail/Admin/EntityNotificationMailer.php b/app/Mail/Admin/EntityNotificationMailer.php
index 29b175426ba5..fe131b3e4eec 100644
--- a/app/Mail/Admin/EntityNotificationMailer.php
+++ b/app/Mail/Admin/EntityNotificationMailer.php
@@ -12,7 +12,7 @@
namespace App\Mail\Admin;
use Illuminate\Mail\Mailable;
-
+//@deprecated?
class EntityNotificationMailer extends Mailable
{
public $mail_obj;
diff --git a/app/Mail/Admin/EntityPaidObject.php b/app/Mail/Admin/EntityPaidObject.php
index c5c32330ef5c..143119d8af05 100644
--- a/app/Mail/Admin/EntityPaidObject.php
+++ b/app/Mail/Admin/EntityPaidObject.php
@@ -52,6 +52,7 @@ class EntityPaidObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -74,8 +75,6 @@ class EntityPaidObject
{
$settings = $this->payment->client->getMergedSettings();
- $signature = $this->generateSignature($settings);
-
$amount = Number::formatMoney($this->payment->amount, $this->payment->client);
$invoice_texts = ctrans('texts.invoice_number_short');
@@ -85,37 +84,30 @@ class EntityPaidObject
}
$invoice_texts = substr($invoice_texts, 0, -1);
+ $content = ctrans(
+ 'texts.notification_payment_paid',
+ ['amount' => $amount,
+ 'client' => $this->payment->client->present()->name(),
+ 'invoice' => $invoice_texts,
+ ]
+ );
$data = [
'title' => ctrans(
'texts.notification_payment_paid_subject',
['client' => $this->payment->client->present()->name()]
),
- 'content' => ctrans(
- 'texts.notification_payment_paid',
- ['amount' => $amount,
- 'client' => $this->payment->client->present()->name(),
- 'invoice' => $invoice_texts,
- ]
- ),
+ 'content' => $content,
'url' => $this->payment->portalUrl($this->use_react_url),
'button' => ctrans('texts.view_payment'),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
}
- private function generateSignature($settings)
- {
- $html_variables = (new PaymentEmailEngine($this->payment, $this->payment->client->primary_contact()->first()))->makeValues();
-
- $signature = str_replace(array_keys($html_variables), array_values($html_variables), $settings->email_signature);
-
- return $signature;
- }
-
}
diff --git a/app/Mail/Admin/EntitySentObject.php b/app/Mail/Admin/EntitySentObject.php
index 294e552a832d..8ba5700eb270 100644
--- a/app/Mail/Admin/EntitySentObject.php
+++ b/app/Mail/Admin/EntitySentObject.php
@@ -98,7 +98,9 @@ class EntitySentObject
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
}
- // nlog($mail_obj);
+
+ $mail_obj->text_view = 'email.template.text';
+
return $mail_obj;
}
@@ -183,16 +185,18 @@ class EntitySentObject
private function getData()
{
$settings = $this->entity->client->getMergedSettings();
-
+ $content = $this->getMessage();
+
return [
'title' => $this->getSubject(),
- 'content' => $this->getMessage(),
+ 'content' => $content,
'url' => $this->invitation->getAdminLink($this->use_react_url),
'button' => ctrans("texts.view_{$this->entity_type}"),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
}
}
diff --git a/app/Mail/Admin/EntityViewedObject.php b/app/Mail/Admin/EntityViewedObject.php
index f84965474dac..c9272fa98bf5 100644
--- a/app/Mail/Admin/EntityViewedObject.php
+++ b/app/Mail/Admin/EntityViewedObject.php
@@ -62,7 +62,7 @@ class EntityViewedObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
-
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -97,22 +97,25 @@ class EntityViewedObject
$settings = $this->company->settings;
}
- $data = [
- 'title' => $this->getSubject(),
- 'message' => ctrans(
+ $content = ctrans(
"texts.notification_{$this->entity_type}_viewed",
[
'amount' => $this->getAmount(),
'client' => $this->contact->present()->name(),
'invoice' => $this->entity->number,
]
- ),
+ );
+
+ $data = [
+ 'title' => $this->getSubject(),
+ 'content' => $content,
'url' => $this->invitation->getAdminLink($this->use_react_url),
'button' => ctrans("texts.view_{$this->entity_type}"),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
diff --git a/app/Mail/Admin/InventoryNotificationObject.php b/app/Mail/Admin/InventoryNotificationObject.php
index 32cb78adcc9c..b73fd181e4e8 100644
--- a/app/Mail/Admin/InventoryNotificationObject.php
+++ b/app/Mail/Admin/InventoryNotificationObject.php
@@ -39,7 +39,7 @@ class InventoryNotificationObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->product->company->company_key;
-
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -59,20 +59,23 @@ class InventoryNotificationObject
private function getData()
{
- $data = [
- 'title' => $this->getSubject(),
- 'content' => ctrans(
+ $content = ctrans(
'texts.inventory_notification_body',
['amount' => $this->getAmount(),
'product' => $this->product->product_key.': '.$this->product->notes,
]
- ),
+ );
+
+ $data = [
+ 'title' => $this->getSubject(),
+ 'content' => $content,
'url' => $this->product->portalUrl($this->use_react_url),
'button' => ctrans('texts.view'),
'signature' => $this->product->company->settings->email_signature,
'logo' => $this->product->company->present()->logo(),
'settings' => $this->product->company->settings,
'whitelabel' => $this->product->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
diff --git a/app/Mail/Admin/PaymentFailureObject.php b/app/Mail/Admin/PaymentFailureObject.php
index 3af11de4536f..61fe41c71ef8 100644
--- a/app/Mail/Admin/PaymentFailureObject.php
+++ b/app/Mail/Admin/PaymentFailureObject.php
@@ -52,6 +52,7 @@ class PaymentFailureObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -73,7 +74,15 @@ class PaymentFailureObject
private function getData()
{
$signature = $this->client->getSetting('email_signature');
-
+ $content = ctrans(
+ 'texts.notification_invoice_payment_failed',
+ [
+ 'client' => $this->client->present()->name(),
+ 'invoice' => $this->getDescription(),
+ 'amount' => Number::formatMoney($this->amount, $this->client),
+ ]
+ );
+
$data = [
'title' => ctrans(
'texts.payment_failed_subject',
@@ -81,14 +90,7 @@ class PaymentFailureObject
'client' => $this->client->present()->name(),
]
),
- 'content' => ctrans(
- 'texts.notification_invoice_payment_failed',
- [
- 'client' => $this->client->present()->name(),
- 'invoice' => $this->getDescription(),
- 'amount' => Number::formatMoney($this->amount, $this->client),
- ]
- ),
+ 'content' => $content,
'signature' => $signature,
'logo' => $this->company->present()->logo(),
'settings' => $this->client->getMergedSettings(),
@@ -96,12 +98,9 @@ class PaymentFailureObject
'url' => $this->client->portalUrl($this->use_react_url),
'button' => $this->use_react_url ? ctrans('texts.view_client') : ctrans('texts.login'),
'additional_info' => $this->error,
+ 'text_body' => $content,
];
- if (strlen($this->error > 1)) {
- $data['content'] .= "\n\n".$this->error;
- }
-
return $data;
}
diff --git a/app/Mail/Admin/PurchaseOrderAcceptedObject.php b/app/Mail/Admin/PurchaseOrderAcceptedObject.php
index 1d25c8814316..00ae2b1b36ea 100644
--- a/app/Mail/Admin/PurchaseOrderAcceptedObject.php
+++ b/app/Mail/Admin/PurchaseOrderAcceptedObject.php
@@ -47,6 +47,7 @@ class PurchaseOrderAcceptedObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -72,22 +73,25 @@ class PurchaseOrderAcceptedObject
{
$settings = $this->company->settings;
- $data = [
- 'title' => $this->getSubject(),
- 'message' => ctrans(
+ $content = ctrans(
'texts.notification_purchase_order_accepted',
[
'amount' => $this->getAmount(),
'vendor' => $this->purchase_order->vendor->present()->name(),
'purchase_order' => $this->purchase_order->number,
]
- ),
+ );
+
+ $data = [
+ 'title' => $this->getSubject(),
+ 'content' => $content,
'url' => $this->purchase_order->invitations->first()->getAdminLink($this->use_react_url),
'button' => ctrans('texts.view_purchase_order'),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
diff --git a/app/Mail/Admin/QuoteApprovedObject.php b/app/Mail/Admin/QuoteApprovedObject.php
index 0c947c250f85..e3675dec19cf 100644
--- a/app/Mail/Admin/QuoteApprovedObject.php
+++ b/app/Mail/Admin/QuoteApprovedObject.php
@@ -47,6 +47,7 @@ class QuoteApprovedObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -71,23 +72,25 @@ class QuoteApprovedObject
private function getData()
{
$settings = $this->quote->client->getMergedSettings();
-
- $data = [
- 'title' => $this->getSubject(),
- 'message' => ctrans(
+ $content = ctrans(
'texts.notification_quote_approved',
[
'amount' => $this->getAmount(),
'client' => $this->quote->client->present()->name(),
'invoice' => $this->quote->number,
]
- ),
+ );
+
+ $data = [
+ 'title' => $this->getSubject(),
+ 'content' => $content,
'url' => $this->quote->invitations->first()->getAdminLink($this->use_react_url),
'button' => ctrans('texts.view_quote'),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
diff --git a/app/Mail/Admin/QuoteExpiredObject.php b/app/Mail/Admin/QuoteExpiredObject.php
index 72706c68a07b..d07969a1384c 100644
--- a/app/Mail/Admin/QuoteExpiredObject.php
+++ b/app/Mail/Admin/QuoteExpiredObject.php
@@ -47,6 +47,7 @@ class QuoteExpiredObject
$mail_obj->data = $this->getData();
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
@@ -71,23 +72,25 @@ class QuoteExpiredObject
private function getData()
{
$settings = $this->quote->client->getMergedSettings();
-
- $data = [
- 'title' => $this->getSubject(),
- 'message' => ctrans(
+ $content = ctrans(
'texts.notification_quote_expired',
[
'amount' => $this->getAmount(),
'client' => $this->quote->client->present()->name(),
'invoice' => $this->quote->number,
]
- ),
+ );
+
+ $data = [
+ 'title' => $this->getSubject(),
+ 'content' => $content,
'url' => $this->quote->invitations->first()->getAdminLink($this->use_react_url),
'button' => $this->use_react_url ? ctrans('texts.view_quote') : ctrans('texts.login'),
'signature' => $settings->email_signature,
'logo' => $this->company->present()->logo(),
'settings' => $settings,
'whitelabel' => $this->company->account->isPaid() ? true : false,
+ 'text_body' => $content,
];
return $data;
diff --git a/app/Mail/Admin/ResetPasswordObject.php b/app/Mail/Admin/ResetPasswordObject.php
index 8c6e58fdf994..66668b56d631 100644
--- a/app/Mail/Admin/ResetPasswordObject.php
+++ b/app/Mail/Admin/ResetPasswordObject.php
@@ -34,12 +34,13 @@ class ResetPasswordObject
$data = [
'title' => ctrans('texts.your_password_reset_link'),
- 'message' => ctrans('texts.reset_password'),
+ 'content' => ctrans('texts.reset_password'),
'url' => route('password.reset', ['token' => $this->token, 'email' => $this->user->email, 'react' => $this->is_react ? 'true' : 'false']),
'button' => ctrans('texts.reset'),
'signature' => $this->company->settings->email_signature,
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
+ 'text_body' => ctrans('texts.reset_password'),
];
$mail_obj = new \stdClass();
@@ -47,6 +48,7 @@ class ResetPasswordObject
$mail_obj->data = $data;
$mail_obj->markdown = 'email.admin.generic';
$mail_obj->tag = $this->company->company_key;
+ $mail_obj->text_view = 'email.template.text';
return $mail_obj;
}
diff --git a/app/Mail/Admin/VerifyUserObject.php b/app/Mail/Admin/VerifyUserObject.php
index 52ae4e74dace..ea69c3fc6052 100644
--- a/app/Mail/Admin/VerifyUserObject.php
+++ b/app/Mail/Admin/VerifyUserObject.php
@@ -46,12 +46,13 @@ class VerifyUserObject
$data = [
'title' => ctrans('texts.confirmation_subject'),
- 'message' => ctrans('texts.confirmation_message'),
+ 'content' => ctrans('texts.confirmation_message'),
'url' => url("/user/confirm/{$this->user->confirmation_code}".$react_redirect),
'button' => ctrans('texts.button_confirmation_message'),
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
'signature' => $this->company->settings->email_signature,
+ 'text_body' => ctrans('texts.confirmation_message'),
];
$mail_obj = new \stdClass();
diff --git a/app/Mail/Migration/MaxCompanies.php b/app/Mail/Migration/MaxCompanies.php
index a9ec9e0803f6..155781e5bb6e 100644
--- a/app/Mail/Migration/MaxCompanies.php
+++ b/app/Mail/Migration/MaxCompanies.php
@@ -28,7 +28,7 @@ class MaxCompanies extends Mailable
public $title;
- public $message;
+ // public $message;
public $whitelabel;
@@ -54,7 +54,7 @@ class MaxCompanies extends Mailable
$this->settings = $this->company->settings;
$this->logo = $this->company->present()->logo();
$this->title = ctrans('texts.max_companies');
- $this->message = ctrans('texts.max_companies_desc');
+ // $this->message = ctrans('texts.max_companies_desc');
$this->whitelabel = $this->company->account->isPaid();
return $this->from(config('mail.from.address'), config('mail.from.name'))
diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php
index 0092fe007671..5c5af991c8e5 100644
--- a/app/Utils/Helpers.php
+++ b/app/Utils/Helpers.php
@@ -100,7 +100,7 @@ class Helpers
break;
case 'switch':
- return trim($value) == 'yes' ? ctrans('texts.yes') : ctrans('texts.no');
+ return trim($value ?? '') == 'yes' ? ctrans('texts.yes') : ctrans('texts.no');
break;
default:
diff --git a/config/ninja.php b/config/ninja.php
index 7c169b6d45e0..d24a549bd556 100644
--- a/config/ninja.php
+++ b/config/ninja.php
@@ -5,7 +5,7 @@ return [
'web_url' => 'https://www.invoiceninja.com',
'admin_token' => env('NINJA_ADMIN_TOKEN', ''),
'license_url' => 'https://app.invoiceninja.com',
- 'react_url' => env('REACT_URL', 'https://app.invoicing.co'),
+ 'react_url' => env('REACT_URL', env('APP_URL', '')),
'production' => env('NINJA_PROD', false),
'license' => env('NINJA_LICENSE', ''),
'version_url' => 'https://pdf.invoicing.co/api/version',
@@ -17,8 +17,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
- 'app_version' => env('APP_VERSION', '5.8.17'),
- 'app_tag' => env('APP_TAG', '5.8.17'),
+ 'app_version' => env('APP_VERSION', '5.8.18'),
+ 'app_tag' => env('APP_TAG', '5.8.18'),
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),
diff --git a/database/migrations/2024_01_29_080555_2024_01_29_update_timezones_naming.php b/database/migrations/2024_01_29_080555_2024_01_29_update_timezones_naming.php
new file mode 100644
index 000000000000..246334af249b
--- /dev/null
+++ b/database/migrations/2024_01_29_080555_2024_01_29_update_timezones_naming.php
@@ -0,0 +1,109 @@
+name = 'Pacific/Apia';
+ $t->save();
+ }
+
+ if($t = Timezone::find(3)) {
+ $t->name = 'Pacific/Honolulu';
+ $t->save();
+ }
+
+ if($t = Timezone::find(4)) {
+ $t->name = 'America/Anchorage';
+ $t->save();
+ }
+
+ if($t = Timezone::find(5)) {
+ $t->name = 'America/Los_Angeles';
+ $t->save();
+ }
+
+ if($t = Timezone::find(7)) {
+ $t->name = 'America/Phoenix';
+ $t->save();
+ }
+
+ if($t = Timezone::find(8)) {
+ $t->name = 'America/Denver';
+ $t->save();
+ }
+
+ if($t = Timezone::find(13)) {
+ $t->name = 'America/Regina';
+ $t->save();
+ }
+
+ if($t = Timezone::find(14)) {
+ $t->name = 'America/Chicago';
+ $t->save();
+ }
+
+ if($t = Timezone::find(15)) {
+ $t->name = 'America/New_York';
+ $t->save();
+ }
+
+ if($t = Timezone::find(16)) {
+ $t->name = 'America/Indiana/Indianapolis';
+ $t->save();
+ }
+
+ if($t = Timezone::find(20)) {
+ $t->name = 'America/Halifax';
+ $t->save();
+ }
+
+ if($t = Timezone::find(23)) {
+ $t->name = 'America/St_Johns';
+ $t->save();
+ }
+
+ if($t = Timezone::find(24)) {
+ $t->name = 'America/Argentina/Buenos_Aires';
+ $t->save();
+ }
+
+ if($t = Timezone::find(25)) {
+ $t->name = 'America/Nuuk';
+ $t->save();
+ }
+
+ if($t = Timezone::find(59)) {
+ $t->name = 'Europe/Kyiv';
+ $t->save();
+ }
+
+ if($t = Timezone::find(90)) {
+ $t->name = 'Asia/Shanghai';
+ $t->save();
+ }
+
+ if($t = Timezone::find(105)) {
+ $t->name = 'Australia/Sydney';
+ $t->save();
+ }
+
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ //
+ }
+};
diff --git a/lang/en/texts.php b/lang/en/texts.php
index ceb0e221993e..72498740f625 100644
--- a/lang/en/texts.php
+++ b/lang/en/texts.php
@@ -693,9 +693,9 @@ $lang = array(
'disable' => 'Disable',
'invoice_quote_number' => 'Invoice and Quote Numbers',
'invoice_charges' => 'Invoice Surcharges',
- 'notification_invoice_bounced' => 'We were unable to deliver Invoice :invoice to :contact.',
+ 'notification_invoice_bounced' => 'We were unable to deliver Invoice :invoice to :contact.
:error',
'notification_invoice_bounced_subject' => 'Unable to deliver Invoice :invoice',
- 'notification_quote_bounced' => 'We were unable to deliver Quote :invoice to :contact.',
+ 'notification_quote_bounced' => 'We were unable to deliver Quote :invoice to :contact.
:error',
'notification_quote_bounced_subject' => 'Unable to deliver Quote :invoice',
'custom_invoice_link' => 'Custom Invoice Link',
'total_invoiced' => 'Total Invoiced',
@@ -3010,7 +3010,7 @@ $lang = array(
'hosted_login' => 'Hosted Login',
'selfhost_login' => 'Selfhost Login',
'google_login' => 'Google Login',
- 'thanks_for_patience' => 'Thank for your patience while we work to implement these features.\n\nWe hope to have them completed in the next few months.\n\nUntil then we\'ll continue to support the',
+ 'thanks_for_patience' => 'Thank for your patience while we work to implement these features.
We hope to have them completed in the next few months.
Until then we\'ll continue to support the',
'legacy_mobile_app' => 'legacy mobile app',
'today' => 'Today',
'current' => 'Current',
@@ -5219,6 +5219,9 @@ $lang = array(
'subscribe' => 'Subscribe',
'subscribe_help' => 'You are currently subscribed and will continue to receive email communications.',
'unsubscribe_help' => 'You are currently not subscribed, and therefore, will not receive emails at this time.',
+ 'notification_purchase_order_bounced' => 'We were unable to deliver Purchase Order :invoice to :contact.
:error',
+ 'notification_purchase_order_bounced_subject' => 'Unable to deliver Purchase Order :invoice',
+
);
return $lang;
diff --git a/resources/views/email/admin/generic.blade.php b/resources/views/email/admin/generic.blade.php
index ece82a8c9057..84e065c488cd 100644
--- a/resources/views/email/admin/generic.blade.php
+++ b/resources/views/email/admin/generic.blade.php
@@ -14,7 +14,7 @@