From 11a774e555786182dd634676811e3c58f316dad0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 18 Feb 2017 20:21:48 -0500 Subject: Send tasks by email --- app/Validator/TaskValidator.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'app/Validator/TaskValidator.php') diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php index 7ca377d9..f9441c8b 100644 --- a/app/Validator/TaskValidator.php +++ b/app/Validator/TaskValidator.php @@ -204,4 +204,27 @@ class TaskValidator extends BaseValidator $v->getErrors() ); } + + /** + * Validate task email creation + * + * @access public + * @param array $values Required parameters to save an action + * @return array $valid, $errors [0] = Success or not, [1] = List of errors + */ + public function validateEmailCreation(array $values) + { + $rules = array( + new Validators\Required('subject', t('This field is required')), + new Validators\Required('email', t('This field is required')), + new Validators\Email('email', t('Email address invalid')), + ); + + $v = new Validator($values, $rules); + + return array( + $v->execute(), + $v->getErrors() + ); + } } -- cgit v1.2.3