mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Email error if import fails
This commit is contained in:
parent
2542b1a640
commit
2fb227714a
@ -67,24 +67,30 @@ class ImportData extends Job implements ShouldQueue
|
||||
$this->user->account->loadLocalizationSettings();
|
||||
}
|
||||
|
||||
if ($this->type === IMPORT_JSON) {
|
||||
$includeData = $this->settings['include_data'];
|
||||
$includeSettings = $this->settings['include_settings'];
|
||||
$files = $this->settings['files'];
|
||||
$results = $importService->importJSON($files[IMPORT_JSON], $includeData, $includeSettings);
|
||||
} elseif ($this->type === IMPORT_CSV) {
|
||||
$map = $this->settings['map'];
|
||||
$headers = $this->settings['headers'];
|
||||
$timestamp = $this->settings['timestamp'];
|
||||
$results = $importService->importCSV($map, $headers, $timestamp);
|
||||
} else {
|
||||
$source = $this->settings['source'];
|
||||
$files = $this->settings['files'];
|
||||
$results = $importService->importFiles($source, $files);
|
||||
try {
|
||||
if ($this->type === IMPORT_JSON) {
|
||||
$includeData = $this->settings['include_data'];
|
||||
$includeSettings = $this->settings['include_settings'];
|
||||
$files = $this->settings['files'];
|
||||
$results = $importService->importJSON($files[IMPORT_JSON], $includeData, $includeSettings);
|
||||
} elseif ($this->type === IMPORT_CSV) {
|
||||
$map = $this->settings['map'];
|
||||
$headers = $this->settings['headers'];
|
||||
$timestamp = $this->settings['timestamp'];
|
||||
$results = $importService->importCSV($map, $headers, $timestamp);
|
||||
} else {
|
||||
$source = $this->settings['source'];
|
||||
$files = $this->settings['files'];
|
||||
$results = $importService->importFiles($source, $files);
|
||||
}
|
||||
|
||||
$subject = trans('texts.import_complete');
|
||||
$message = $importService->presentResults($results, $includeSettings);
|
||||
} catch (Exception $exception) {
|
||||
$subject = trans('texts.import_failed');
|
||||
$message = $exception->getMessage();
|
||||
}
|
||||
|
||||
$subject = trans('texts.import_complete');
|
||||
$message = $importService->presentResults($results, $includeSettings);
|
||||
$userMailer->sendMessage($this->user, $subject, $message);
|
||||
|
||||
if (App::runningInConsole()) {
|
||||
|
@ -43,7 +43,7 @@ class HandleUserLoggedIn
|
||||
{
|
||||
$account = Auth::user()->account;
|
||||
|
||||
if (empty($account->last_login)) {
|
||||
if (! Utils::isNinja() && empty($account->last_login)) {
|
||||
event(new UserSignedUp());
|
||||
}
|
||||
|
||||
|
@ -2289,7 +2289,7 @@ $LANG = array(
|
||||
'deleted_recurring_expense' => 'Successfully deleted :count projects',
|
||||
'view_recurring_expense' => 'View Recurring Expense',
|
||||
'other' => 'Other',
|
||||
|
||||
'import_failed' => 'Import Failed',
|
||||
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user