mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added preview for email templates
This commit is contained in:
parent
bce4395f82
commit
6971060049
@ -1305,7 +1305,15 @@ class AccountController extends BaseController
|
||||
public function previewEmail(\App\Services\TemplateService $templateService)
|
||||
{
|
||||
$template = Input::get('template');
|
||||
$invoice = Invoice::scope()->first();
|
||||
$invoice = Invoice::scope()
|
||||
->invoices()
|
||||
->withTrashed()
|
||||
->first();
|
||||
|
||||
if ( ! $invoice) {
|
||||
return trans('texts.create_invoice_for_sample');
|
||||
}
|
||||
|
||||
$account = Auth::user()->account;
|
||||
|
||||
// replace the variables with sample data
|
||||
|
@ -228,6 +228,12 @@ class Invoice extends EntityModel implements BalanceAffecting
|
||||
return $this->hasMany('App\Models\Expense','invoice_id','id')->withTrashed();
|
||||
}
|
||||
|
||||
public function scopeInvoices($query)
|
||||
{
|
||||
return $query->where('is_quote', '=', false)
|
||||
->where('is_recurring', '=', false);
|
||||
}
|
||||
|
||||
public function markInvitationsSent($notify = false)
|
||||
{
|
||||
foreach ($this->invitations as $invitation) {
|
||||
|
@ -81,7 +81,7 @@
|
||||
|
||||
|
||||
<div class="modal fade" id="templatePreviewModal" tabindex="-1" role="dialog" aria-labelledby="templatePreviewModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" style="min-width:700px">
|
||||
<div class="modal-dialog" style="width:800px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
@ -12,7 +12,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-collapse: collapse;">
|
||||
<table cellpadding="10" cellspacing="0" border="0" bgcolor="#F4F5F5" width="580" align="center"
|
||||
<table cellpadding="10" cellspacing="0" border="0" bgcolor="#F4F5F5" width="600" align="center"
|
||||
class="header" style="border-top-width: 6px; border-top-color: {{ $account->primary_color ?: '#2E2B2B' }}; border-top-style: solid;">
|
||||
<tr>
|
||||
<td class="logo" width="208" style="border-collapse: collapse; vertical-align: middle;" valign="middle">
|
||||
|
@ -12,7 +12,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-collapse: collapse;">
|
||||
<table cellpadding="10" cellspacing="0" border="0" bgcolor="{{ $account->primary_color ?: '#2E2B2B' }}" width="580" align="center" class="header"
|
||||
<table cellpadding="10" cellspacing="0" border="0" bgcolor="{{ $account->primary_color ?: '#2E2B2B' }}" width="600" align="center" class="header"
|
||||
style="border-bottom-width: 6px; border-bottom-color: {{ $account->primary_color ?: '#2E2B2B' }}; border-bottom-style: solid;">
|
||||
<tr>
|
||||
<td class="logo" width="205" style="border-collapse: collapse; vertical-align: middle; line-height: 16px;" valign="middle">
|
||||
|
Loading…
x
Reference in New Issue
Block a user