mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 13:44:35 -04:00
Analytics
This commit is contained in:
parent
ac3b0dfad3
commit
b4945220e8
@ -54,4 +54,22 @@ class EmailFailure
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $string_metric6 = '';
|
public $string_metric6 = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The counter
|
||||||
|
* set to 1.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Company Key
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $string_metric7 = '';
|
||||||
|
|
||||||
|
public function __construct($string_metric7) {
|
||||||
|
$this->string_metric7 = $string_metric7;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
76
app/DataMapper/Analytics/EmailSuccess.php
Normal file
76
app/DataMapper/Analytics/EmailSuccess.php
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\DataMapper\Analytics;
|
||||||
|
|
||||||
|
class EmailSuccess
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of Sample.
|
||||||
|
*
|
||||||
|
* Monotonically incrementing counter
|
||||||
|
*
|
||||||
|
* - counter
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $type = 'mixed_metric';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the counter.
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $name = 'job.success.email';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The datetime of the counter measurement.
|
||||||
|
*
|
||||||
|
* date("Y-m-d H:i:s")
|
||||||
|
*
|
||||||
|
* @var DateTime
|
||||||
|
*/
|
||||||
|
public $datetime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class failure name
|
||||||
|
* set to 0.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $string_metric5 = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The exception string
|
||||||
|
* set to 0.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $string_metric6 = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The counter
|
||||||
|
* set to 1.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $int_metric1 = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Company Key
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $string_metric7 = '';
|
||||||
|
|
||||||
|
public function __construct($string_metric7) {
|
||||||
|
$this->string_metric7 = $string_metric7;
|
||||||
|
}
|
||||||
|
}
|
@ -12,6 +12,7 @@
|
|||||||
namespace App\Jobs\Mail;
|
namespace App\Jobs\Mail;
|
||||||
|
|
||||||
use App\DataMapper\Analytics\EmailFailure;
|
use App\DataMapper\Analytics\EmailFailure;
|
||||||
|
use App\DataMapper\Analytics\EmailSuccess;
|
||||||
use App\Events\Invoice\InvoiceWasEmailedAndFailed;
|
use App\Events\Invoice\InvoiceWasEmailedAndFailed;
|
||||||
use App\Events\Payment\PaymentWasEmailedAndFailed;
|
use App\Events\Payment\PaymentWasEmailedAndFailed;
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
@ -180,6 +181,8 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
$message->getHeaders()->addTextHeader('GmailToken', $token);
|
$message->getHeaders()->addTextHeader('GmailToken', $token);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
LightLogs::create(new EmailSuccess($this->nmo->company_key->company_key))
|
||||||
|
->batch();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function logMailError($errors, $recipient_object)
|
private function logMailError($errors, $recipient_object)
|
||||||
@ -198,7 +201,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
nlog('mailer job failed');
|
nlog('mailer job failed');
|
||||||
nlog($exception->getMessage());
|
nlog($exception->getMessage());
|
||||||
|
|
||||||
$job_failure = new EmailFailure();
|
$job_failure = new EmailFailure($this->nmo->company->company_key);
|
||||||
$job_failure->string_metric5 = get_parent_class($this);
|
$job_failure->string_metric5 = get_parent_class($this);
|
||||||
$job_failure->string_metric6 = $exception->getMessage();
|
$job_failure->string_metric6 = $exception->getMessage();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user