1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Utils/Helpers.php

41 lines
939 B
PHP
Raw Normal View History

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Utils;
use App\Models\Client;
2020-10-28 11:10:49 +01:00
use stdClass;
class Helpers
{
2020-10-01 13:41:23 +02:00
public static function sharedEmailVariables(?Client $client, array $settings = null): array
{
2020-10-01 13:41:23 +02:00
if(!$client){
$elements['signature'] = '';
2020-10-28 11:10:49 +01:00
$elements['settings'] = new stdClass;
2020-10-01 13:41:23 +02:00
$elements['whitelabel'] = true;
return $elements;
}
$_settings = is_null($settings) ? $client->getMergedSettings() : $settings;
$elements['signature'] = $_settings->email_signature;
$elements['settings'] = $_settings;
$elements['whitelabel'] = $client->user->account->isPaid() ? true : false;
return $elements;
}
}