1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Add registered/confirmed in email subject

This commit is contained in:
Hillel Coren 2018-04-12 21:11:23 +03:00
parent 1459dabe67
commit 4a3d0cd430
2 changed files with 28 additions and 11 deletions

View File

@ -149,17 +149,7 @@ class HomeController extends BaseController
$subject = 'Customer Message [';
if (Utils::isNinjaProd()) {
$subject .= str_replace('db-ninja-', '', config('database.default'));
$account = Auth::user()->account;
if ($account->isTrial()) {
$subject .= 'T';
} elseif ($account->isEnterprise()) {
$subject .= 'E';
} elseif ($account->isPro()) {
$subject .= 'P';
} else {
$subject .= 'H';
}
$subject .= '] ';
$subject .= Auth::user()->present()->statusCode . '] ';
} else {
$subject .= 'Self-Host] | ';
}

View File

@ -13,4 +13,31 @@ class UserPresenter extends EntityPresenter
{
return $this->entity->first_name . ' ' . $this->entity->last_name;
}
public function statusCode()
{
$status = '';
$user = $this->entity;
$account = $user->account;
if ($user->confirmed) {
$status .= 'C';
} elseif ($user->registered) {
$status .= 'R';
} else {
$status .= 'N';
}
if ($account->isTrial()) {
$status .= 'T';
} elseif ($account->isEnterprise()) {
$status .= 'E';
} elseif ($account->isPro()) {
$status .= 'P';
} else {
$status .= 'H';
}
return $status;
}
}