mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #4113 from beganovich/v2-centralised-email-variables
E-mail centralised variables
This commit is contained in:
commit
0186edaf7c
29
app/Utils/Helpers.php
Normal file
29
app/Utils/Helpers.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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;
|
||||
|
||||
class Helpers
|
||||
{
|
||||
public static function sharedEmailVariables(Client $client, array $settings = null): array
|
||||
{
|
||||
$_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;
|
||||
}
|
||||
}
|
@ -171,9 +171,8 @@ class TemplateEngine
|
||||
$data['title'] = '';
|
||||
$data['body'] = '$body';
|
||||
$data['footer'] = '';
|
||||
$data['signature'] = $this->settings_entity->getSetting('email_signature');
|
||||
$data['settings'] = $this->settings;
|
||||
$data['whitelabel'] = $this->entity_obj->client->user->account->isPaid() ? true : false;
|
||||
|
||||
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
||||
|
||||
if ($email_style == 'custom') {
|
||||
$wrapper = $this->settings_entity->getSetting('email_style_custom');
|
||||
|
@ -59,12 +59,14 @@ if(!isset($design)) $design = 'light';
|
||||
</div>
|
||||
|
||||
<!-- Whitelabel -->
|
||||
@if(!$whitelabel)
|
||||
<div style="display: flex; flex-direction: row; justify-content: center; margin-top: 1rem; margin-bottom: 1rem;">
|
||||
<a href="https://invoiceninja.com" target="_blank">
|
||||
<img style="height: 4rem;" src="{{ asset('images/created-by-invoiceninja-new.png') }}" alt="Invoice Ninja">
|
||||
</a>
|
||||
</div>
|
||||
@isset($whitelabel)
|
||||
@if(!$whitelabel)
|
||||
<div style="display: flex; flex-direction: row; justify-content: center; margin-top: 1rem; margin-bottom: 1rem;">
|
||||
<a href="https://invoiceninja.com" target="_blank">
|
||||
<img style="height: 4rem;" src="{{ asset('images/created-by-invoiceninja-new.png') }}" alt="Invoice Ninja">
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user