mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
commit
a79447d4cf
@ -181,11 +181,6 @@ class EmailEntity extends BaseMailerJob implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function findReminderTemplate()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private function resolveEmailBuilder()
|
private function resolveEmailBuilder()
|
||||||
{
|
{
|
||||||
$class = 'App\Mail\Engine\\' . ucfirst(Str::camel($this->entity_string)) . "EmailEngine";
|
$class = 'App\Mail\Engine\\' . ucfirst(Str::camel($this->entity_string)) . "EmailEngine";
|
||||||
|
@ -214,13 +214,17 @@ class SendReminders implements ShouldQueue
|
|||||||
$invoice->invitations->each(function ($invitation) use($template, $invoice){
|
$invoice->invitations->each(function ($invitation) use($template, $invoice){
|
||||||
|
|
||||||
//only send if enable_reminder setting is toggled to yes
|
//only send if enable_reminder setting is toggled to yes
|
||||||
if($this->checkSendSetting($invoice, $template))
|
if($this->checkSendSetting($invoice, $template)) {
|
||||||
EmailEntity::dispatch($invitation, $invitation->company, $template);
|
|
||||||
|
EmailEntity::dispatchNow($invitation, $invitation->company, $template);
|
||||||
|
|
||||||
|
event(new InvoiceWasEmailed($invitation, $invoice->company, Ninja::eventVars()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($invoice->invitations->count() > 0)
|
|
||||||
event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars()));
|
|
||||||
|
|
||||||
$invoice->last_sent_date = now();
|
$invoice->last_sent_date = now();
|
||||||
$invoice->next_send_date = $this->calculateNextSendDate($invoice);
|
$invoice->next_send_date = $this->calculateNextSendDate($invoice);
|
||||||
|
@ -261,7 +261,7 @@ class Import implements ShouldQueue
|
|||||||
$company_repository = new CompanyRepository();
|
$company_repository = new CompanyRepository();
|
||||||
$company_repository->save($data, $this->company);
|
$company_repository->save($data, $this->company);
|
||||||
|
|
||||||
if(isset($data['settings']->company_logo)) {
|
if(isset($data['settings']->company_logo) && strlen($data['settings']->company_logo) > 0) {
|
||||||
|
|
||||||
$tempImage = tempnam(sys_get_temp_dir(), basename($data['settings']->company_logo));
|
$tempImage = tempnam(sys_get_temp_dir(), basename($data['settings']->company_logo));
|
||||||
copy($data['settings']->company_logo, $tempImage);
|
copy($data['settings']->company_logo, $tempImage);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Mail\Engine;
|
namespace App\Mail\Engine;
|
||||||
|
|
||||||
|
use App\DataMapper\EmailTemplateDefaults;
|
||||||
use App\Utils\HtmlEngine;
|
use App\Utils\HtmlEngine;
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
|
|
||||||
@ -43,8 +44,10 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
|
|
||||||
if(is_array($this->template_data) && array_key_exists('body', $this->template_data) && strlen($this->template_data['body']) > 0)
|
if(is_array($this->template_data) && array_key_exists('body', $this->template_data) && strlen($this->template_data['body']) > 0)
|
||||||
$body_template = $this->template_data['body'];
|
$body_template = $this->template_data['body'];
|
||||||
else
|
else{
|
||||||
$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
//$body_template = $this->client->getSetting('email_template_'.$this->reminder_template);
|
||||||
|
$body_template = EmailTemplateDefaults::getDefaultTemplate($this->client->getSetting('email_template_'.$this->reminder_template), $this->client->locale());
|
||||||
|
}
|
||||||
|
|
||||||
/* Use default translations if a custom message has not been set*/
|
/* Use default translations if a custom message has not been set*/
|
||||||
if (iconv_strlen($body_template) == 0) {
|
if (iconv_strlen($body_template) == 0) {
|
||||||
@ -62,8 +65,10 @@ class InvoiceEmailEngine extends BaseEmailEngine
|
|||||||
|
|
||||||
if(is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0)
|
if(is_array($this->template_data) && array_key_exists('subject', $this->template_data) && strlen($this->template_data['subject']) > 0)
|
||||||
$subject_template = $this->template_data['subject'];
|
$subject_template = $this->template_data['subject'];
|
||||||
else
|
else{
|
||||||
$subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template);
|
$subject_template = EmailTemplateDefaults::getDefaultTemplate($this->client->getSetting('email_subject_'.$this->reminder_template), $this->client->locale());
|
||||||
|
// $subject_template = $this->client->getSetting('email_subject_'.$this->reminder_template);
|
||||||
|
}
|
||||||
|
|
||||||
if (iconv_strlen($subject_template) == 0) {
|
if (iconv_strlen($subject_template) == 0) {
|
||||||
|
|
||||||
|
@ -84,38 +84,6 @@ class MigrationTest extends TestCase
|
|||||||
$this->assertEquals($co->count(), 1);
|
$this->assertEquals($co->count(), 1);
|
||||||
$this->assertEquals($inv->count(), 1);
|
$this->assertEquals($inv->count(), 1);
|
||||||
|
|
||||||
// DB::statement( 'DELETE FROM `clients` WHERE `company_id`=:company_id', array('company_id' => $this->company->id) );
|
|
||||||
|
|
||||||
// $co = Client::whereCompanyId($this->company->id)->get();
|
|
||||||
// $inv = Invoice::whereCompanyId($this->company->id)->get();
|
|
||||||
|
|
||||||
// $this->assertEquals($co->count(),0);
|
|
||||||
// $this->assertEquals($inv->count(),0);
|
|
||||||
|
|
||||||
// $this->assertNotNull($this->company);
|
|
||||||
// $this->assertNotNull($this->company->settings);
|
|
||||||
// $this->assertNotNull($this->company->settings->timezone_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function testMigrationFileUpload()
|
|
||||||
// {
|
|
||||||
// $file = new UploadedFile(base_path('tests/Unit/Migration/migration.zip'), 'migration.zip');
|
|
||||||
|
|
||||||
// $data = [
|
|
||||||
// 'migration' => $file,
|
|
||||||
// 'force' => true,
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// $token = $this->company->tokens->first()->token;
|
|
||||||
|
|
||||||
// $response = $this->withHeaders([
|
|
||||||
// 'X-API-TOKEN' => $token,
|
|
||||||
// 'X-API-SECRET' => config('ninja.api_secret'),
|
|
||||||
// 'X-Requested-With' => 'XMLHttpRequest',
|
|
||||||
// 'X-API-PASSWORD' => 'ALongAndBriliantPassword',
|
|
||||||
// ])->post('/api/v1/migration/start', $data);
|
|
||||||
|
|
||||||
// $response->assertStatus(200);
|
|
||||||
// $this->assertTrue(file_exists(base_path('storage/migrations/migration/migration.json')));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
@ -65638,7 +65638,7 @@
|
|||||||
"accepted_credit_cards": 0,
|
"accepted_credit_cards": 0,
|
||||||
"require_cvv": 1,
|
"require_cvv": 1,
|
||||||
"require_billing_address": null,
|
"require_billing_address": null,
|
||||||
"show_shipping_address": 0,
|
"require_shipping_address": 0,
|
||||||
"update_details": null,
|
"update_details": null,
|
||||||
"config": "{\"apiKey\":\"345345345\",\"publishableKey\":\"5435345\",\"plaidClientId\":\"\",\"plaidSecret\":\"\",\"plaidPublicKey\":\"\",\"enableAlipay\":false,\"enableSofort\":false,\"enableSepa\":false,\"enableBitcoin\":false,\"enableApplePay\":false,\"enableAch\":false}",
|
"config": "{\"apiKey\":\"345345345\",\"publishableKey\":\"5435345\",\"plaidClientId\":\"\",\"plaidSecret\":\"\",\"plaidPublicKey\":\"\",\"enableAlipay\":false,\"enableSofort\":false,\"enableSepa\":false,\"enableBitcoin\":false,\"enableApplePay\":false,\"enableAch\":false}",
|
||||||
"fees_and_limits": {
|
"fees_and_limits": {
|
||||||
@ -65667,7 +65667,7 @@
|
|||||||
"accepted_credit_cards": 0,
|
"accepted_credit_cards": 0,
|
||||||
"require_cvv": 1,
|
"require_cvv": 1,
|
||||||
"require_billing_address": null,
|
"require_billing_address": null,
|
||||||
"show_shipping_address": 0,
|
"require_shipping_address": 0,
|
||||||
"update_details": null,
|
"update_details": null,
|
||||||
"config": "{\"apiKey\":\"345345345\",\"publishableKey\":\"5435345\",\"plaidClientId\":\"\",\"plaidSecret\":\"\",\"plaidPublicKey\":\"\",\"enableAlipay\":false,\"enableSofort\":false,\"enableSepa\":false,\"enableBitcoin\":false,\"enableApplePay\":false,\"enableAch\":false}",
|
"config": "{\"apiKey\":\"345345345\",\"publishableKey\":\"5435345\",\"plaidClientId\":\"\",\"plaidSecret\":\"\",\"plaidPublicKey\":\"\",\"enableAlipay\":false,\"enableSofort\":false,\"enableSepa\":false,\"enableBitcoin\":false,\"enableApplePay\":false,\"enableAch\":false}",
|
||||||
"fees_and_limits": {},
|
"fees_and_limits": {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user