2019-11-22 22:10:53 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2020-01-07 01:13:47 +01:00
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-11-22 22:10:53 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\DataMapper;
|
|
|
|
|
2020-01-20 02:31:58 +01:00
|
|
|
use League\CommonMark\CommonMarkConverter;
|
2019-11-22 22:10:53 +01:00
|
|
|
|
|
|
|
class EmailTemplateDefaults
|
|
|
|
{
|
|
|
|
public static function emailInvoiceSubject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.invoice_subject', ['number'=>'$number', 'account'=>'$company.name']);
|
2019-12-10 21:25:54 +01:00
|
|
|
//return Parsedown::instance()->line(self::transformText('invoice_subject'));
|
2019-11-22 22:10:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailInvoiceTemplate()
|
|
|
|
{
|
2020-01-20 02:31:58 +01:00
|
|
|
$converter = new CommonMarkConverter([
|
|
|
|
'html_input' => 'strip',
|
|
|
|
'allow_unsafe_links' => false,
|
|
|
|
]);
|
|
|
|
|
|
|
|
return $converter->convertToHtml(self::transformText('invoice_message'));
|
|
|
|
|
|
|
|
//return Parsedown::instance()->line(self::transformText('invoice_message'));
|
2019-11-22 22:10:53 +01:00
|
|
|
}
|
|
|
|
|
2019-11-24 07:37:53 +01:00
|
|
|
public static function emailQuoteSubject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.quote_subject', ['number'=>'$number', 'account'=>'$company.name']);
|
2019-12-10 21:25:54 +01:00
|
|
|
|
|
|
|
//return Parsedown::instance()->line(self::transformText('quote_subject'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailQuoteTemplate()
|
|
|
|
{
|
2020-01-20 02:31:58 +01:00
|
|
|
$converter = new CommonMarkConverter([
|
|
|
|
'html_input' => 'strip',
|
|
|
|
'allow_unsafe_links' => false,
|
|
|
|
]);
|
|
|
|
|
|
|
|
return $converter->convertToHtml(self::transformText('quote_message'));
|
|
|
|
//return Parsedown::instance()->line(self::transformText('quote_message'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailPaymentSubject()
|
|
|
|
{
|
2019-12-10 21:25:54 +01:00
|
|
|
return ctrans('texts.payment_subject');
|
|
|
|
//return Parsedown::instance()->line(self::transformText('payment_subject'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailPaymentTemplate()
|
|
|
|
{
|
|
|
|
return Parsedown::instance()->line(self::transformText('payment_message'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder1Subject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.reminder_subject', ['invoice'=>'$invoice.number', 'account'=>'$company.name']);
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder1Template()
|
|
|
|
{
|
2020-01-20 02:31:58 +01:00
|
|
|
// return Parsedown::instance()->line('First Email Reminder Text');
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder2Subject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.reminder_subject', ['invoice'=>'$invoice.number', 'account'=>'$company.name']);
|
2019-12-10 21:25:54 +01:00
|
|
|
// return Parsedown::instance()->line(self::transformText('reminder_subject'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder2Template()
|
|
|
|
{
|
2020-01-20 02:31:58 +01:00
|
|
|
// return Parsedown::instance()->line('Second Email Reminder Text');
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder3Subject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.reminder_subject', ['invoice'=>'$invoice.number', 'account'=>'$company.name']);
|
2019-12-10 21:25:54 +01:00
|
|
|
// return Parsedown::instance()->line(self::transformText('reminder_subject'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminder3Template()
|
|
|
|
{
|
2020-01-20 02:31:58 +01:00
|
|
|
// return Parsedown::instance()->line('Third Email Reminder Text');
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminderEndlessSubject()
|
|
|
|
{
|
2019-12-16 12:34:38 +01:00
|
|
|
return ctrans('texts.reminder_subject', ['invoice'=>'$invoice.number', 'account'=>'$company.name']);
|
2019-12-10 21:25:54 +01:00
|
|
|
// return Parsedown::instance()->line(self::transformText('reminder_subject'));
|
2019-11-24 07:37:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailReminderEndlessTemplate()
|
|
|
|
{
|
|
|
|
return Parsedown::instance()->line('Endless Email Reminder Text');
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailStatementSubject()
|
|
|
|
{
|
|
|
|
return Parsedown::instance()->line('Statement Subject needs texts record!');
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function emailStatementTemplate()
|
|
|
|
{
|
|
|
|
return Parsedown::instance()->line('Statement Templates needs texts record!');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-11-22 22:10:53 +01:00
|
|
|
private static function transformText($string)
|
|
|
|
{
|
|
|
|
return str_replace(":", "$", ctrans('texts.'.$string));
|
|
|
|
}
|
|
|
|
}
|