mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 11:24:34 -04:00
Clean up for email sending API
This commit is contained in:
parent
964563dce4
commit
6e17404cac
@ -36,11 +36,9 @@ class SendEmailRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'template' => 'required',
|
'template' => 'bail|required',
|
||||||
'entity' => 'required',
|
'entity' => 'bail|required',
|
||||||
'entity_id' => 'required',
|
'entity_id' => 'bail|required',
|
||||||
// 'subject' => 'required',
|
|
||||||
// 'body' => 'required',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,8 +56,11 @@ class SendEmailRequest extends Request
|
|||||||
unset($input['template']);
|
unset($input['template']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
if(array_key_exists('entity_id', $input))
|
||||||
$input['entity'] = "App\Models\\".ucfirst($input['entity']);
|
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
||||||
|
|
||||||
|
if(array_key_exists('entity', $input))
|
||||||
|
$input['entity'] = "App\Models\\".ucfirst($input['entity']);
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user