mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -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()
|
||||
{
|
||||
return [
|
||||
'template' => 'required',
|
||||
'entity' => 'required',
|
||||
'entity_id' => 'required',
|
||||
// 'subject' => 'required',
|
||||
// 'body' => 'required',
|
||||
'template' => 'bail|required',
|
||||
'entity' => 'bail|required',
|
||||
'entity_id' => 'bail|required',
|
||||
];
|
||||
}
|
||||
|
||||
@ -58,8 +56,11 @@ class SendEmailRequest extends Request
|
||||
unset($input['template']);
|
||||
}
|
||||
|
||||
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
||||
$input['entity'] = "App\Models\\".ucfirst($input['entity']);
|
||||
if(array_key_exists('entity_id', $input))
|
||||
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id']);
|
||||
|
||||
if(array_key_exists('entity', $input))
|
||||
$input['entity'] = "App\Models\\".ucfirst($input['entity']);
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user