BCC email

This commit is contained in:
Hillel Coren 2017-01-06 15:24:53 +02:00
parent 0938c4cb1a
commit c8345e8fc1
5 changed files with 16 additions and 1 deletions

View File

@ -959,6 +959,7 @@ class AccountController extends BaseController
$account->pdf_email_attachment = Input::get('pdf_email_attachment') ? true : false; $account->pdf_email_attachment = Input::get('pdf_email_attachment') ? true : false;
$account->document_email_attachment = Input::get('document_email_attachment') ? true : false; $account->document_email_attachment = Input::get('document_email_attachment') ? true : false;
$account->email_design_id = Input::get('email_design_id'); $account->email_design_id = Input::get('email_design_id');
$account->bcc_email = Input::get('bcc_email');
if (Utils::isNinja()) { if (Utils::isNinja()) {
$account->enable_email_markup = Input::get('enable_email_markup') ? true : false; $account->enable_email_markup = Input::get('enable_email_markup') ? true : false;

View File

@ -199,6 +199,7 @@ class ContactMailer extends Mailer
'invoice' => $invoice, 'invoice' => $invoice,
'documents' => $documentStrings, 'documents' => $documentStrings,
'notes' => $reminder, 'notes' => $reminder,
'bcc_email' => $account->isPro() ? $account->bcc_email : false,
]; ];
if ($account->attachPDF()) { if ($account->attachPDF()) {
@ -285,6 +286,7 @@ class ContactMailer extends Mailer
'account' => $account, 'account' => $account,
'payment' => $payment, 'payment' => $payment,
'entityType' => ENTITY_INVOICE, 'entityType' => ENTITY_INVOICE,
'bcc_email' => $account->isPro() ? $account->bcc_email : false,
]; ];
if ($account->attachPDF()) { if ($account->attachPDF()) {

View File

@ -47,6 +47,11 @@ class Mailer
->replyTo($replyEmail, $fromName) ->replyTo($replyEmail, $fromName)
->subject($subject); ->subject($subject);
// Optionally BCC the email
if (!empty($data['bcc_email'])) {
$message->bcc($data['bcc_email']);
}
// Attach the PDF to the email // Attach the PDF to the email
if (!empty($data['pdfString']) && !empty($data['pdfFileName'])) { if (!empty($data['pdfString']) && !empty($data['pdfFileName'])) {
$message->attachData($data['pdfString'], $data['pdfFileName']); $message->attachData($data['pdfString'], $data['pdfFileName']);

View File

@ -2304,6 +2304,8 @@ $LANG = array(
'notes_reminder1' => 'First Reminder', 'notes_reminder1' => 'First Reminder',
'notes_reminder2' => 'Second Reminder', 'notes_reminder2' => 'Second Reminder',
'notes_reminder3' => 'Third Reminder', 'notes_reminder3' => 'Third Reminder',
'bcc_email' => 'BCC Email',
'bcc_email_help' => 'All emails sent to your clients will also be sent to this address.',
); );

View File

@ -15,7 +15,8 @@
@include('accounts.nav', ['selected' => ACCOUNT_EMAIL_SETTINGS, 'advanced' => true]) @include('accounts.nav', ['selected' => ACCOUNT_EMAIL_SETTINGS, 'advanced' => true])
{!! Former::open()->rules([ {!! Former::open()->rules([
'iframe_url' => 'url' 'iframe_url' => 'url',
'bcc_email' => 'email',
])->addClass('warn-on-exit') !!} ])->addClass('warn-on-exit') !!}
{{ Former::populate($account) }} {{ Former::populate($account) }}
{{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }} {{ Former::populateField('pdf_email_attachment', intval($account->pdf_email_attachment)) }}
@ -40,6 +41,10 @@
   
{!! Former::text('bcc_email')->help('bcc_email_help') !!}
 
{{-- Former::select('recurring_hour')->options($recurringHours) --}} {{-- Former::select('recurring_hour')->options($recurringHours) --}}
{!! Former::inline_radios('custom_invoice_link') {!! Former::inline_radios('custom_invoice_link')