Merge pull request #957 from gpasztor87/master
Add validation rules for mail settings.
This commit is contained in:
commit
cb39d41a09
|
|
@ -385,7 +385,7 @@ class FormField
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds attribues used specifically by the TriggerAPI
|
||||
* Adds attributes used specifically by the TriggerAPI
|
||||
* @param array $attributes
|
||||
* @param string $position
|
||||
* @return array
|
||||
|
|
|
|||
|
|
@ -713,7 +713,7 @@ class Form extends WidgetBase
|
|||
|
||||
/**
|
||||
* Parses a field's name
|
||||
* @param stirng $field Field name
|
||||
* @param string $field Field name
|
||||
* @return array [columnName, context]
|
||||
*/
|
||||
public function getFieldName($field)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ use Model;
|
|||
*/
|
||||
class MailSettings extends Model
|
||||
{
|
||||
use \October\Rain\Database\Traits\Validation;
|
||||
|
||||
public $implement = ['System.Behaviors.SettingsModel'];
|
||||
|
||||
public $settingsCode = 'system_mail_settings';
|
||||
|
|
@ -23,6 +25,14 @@ class MailSettings extends Model
|
|||
const MODE_MAILGUN = 'mailgun';
|
||||
const MODE_MANDRILL = 'mandrill';
|
||||
|
||||
/*
|
||||
* Validation rules
|
||||
*/
|
||||
public $rules = [
|
||||
'sender_name' => 'required',
|
||||
'sender_email' => 'required|email'
|
||||
];
|
||||
|
||||
public function initSettingsData()
|
||||
{
|
||||
$config = App::make('config');
|
||||
|
|
|
|||
Loading…
Reference in New Issue