mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 16:24:35 -04: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['title'] = '';
|
||||||
$data['body'] = '$body';
|
$data['body'] = '$body';
|
||||||
$data['footer'] = '';
|
$data['footer'] = '';
|
||||||
$data['signature'] = $this->settings_entity->getSetting('email_signature');
|
|
||||||
$data['settings'] = $this->settings;
|
$data = array_merge($data, Helpers::sharedEmailVariables($this->entity_obj->client));
|
||||||
$data['whitelabel'] = $this->entity_obj->client->user->account->isPaid() ? true : false;
|
|
||||||
|
|
||||||
if ($email_style == 'custom') {
|
if ($email_style == 'custom') {
|
||||||
$wrapper = $this->settings_entity->getSetting('email_style_custom');
|
$wrapper = $this->settings_entity->getSetting('email_style_custom');
|
||||||
|
@ -59,12 +59,14 @@ if(!isset($design)) $design = 'light';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Whitelabel -->
|
<!-- Whitelabel -->
|
||||||
@if(!$whitelabel)
|
@isset($whitelabel)
|
||||||
<div style="display: flex; flex-direction: row; justify-content: center; margin-top: 1rem; margin-bottom: 1rem;">
|
@if(!$whitelabel)
|
||||||
<a href="https://invoiceninja.com" target="_blank">
|
<div style="display: flex; flex-direction: row; justify-content: center; margin-top: 1rem; margin-bottom: 1rem;">
|
||||||
<img style="height: 4rem;" src="{{ asset('images/created-by-invoiceninja-new.png') }}" alt="Invoice Ninja">
|
<a href="https://invoiceninja.com" target="_blank">
|
||||||
</a>
|
<img style="height: 4rem;" src="{{ asset('images/created-by-invoiceninja-new.png') }}" alt="Invoice Ninja">
|
||||||
</div>
|
</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
x
Reference in New Issue
Block a user