Add checking for email address if email checkbox is checked. #408
This commit is contained in:
parent
af85a632e5
commit
bbebdb04c8
2 changed files with 20 additions and 0 deletions
|
|
@ -177,6 +177,15 @@ class ResqCustomerHandler implements CustomerHandlerInterface
|
||||||
if (!$is_dpa_checked)
|
if (!$is_dpa_checked)
|
||||||
$error_array['flag_dpa_consent'] = 'DPA consent should be checked.';
|
$error_array['flag_dpa_consent'] = 'DPA consent should be checked.';
|
||||||
|
|
||||||
|
// check if email marketing promo is checked
|
||||||
|
$is_email_promo_checked = $req->request->get('flag_promo_email');
|
||||||
|
if ($is_email_promo_checked)
|
||||||
|
{
|
||||||
|
// check email field
|
||||||
|
if (empty($req->request->get('email')))
|
||||||
|
$error_array['email'] = 'Email address required.';
|
||||||
|
}
|
||||||
|
|
||||||
$this->setObject($row, $req);
|
$this->setObject($row, $req);
|
||||||
|
|
||||||
// custom validation for vehicles
|
// custom validation for vehicles
|
||||||
|
|
@ -335,6 +344,16 @@ class ResqCustomerHandler implements CustomerHandlerInterface
|
||||||
if (!$is_dpa_checked)
|
if (!$is_dpa_checked)
|
||||||
$error_array['flag_dpa_consent'] = 'DPA consent should be checked.';
|
$error_array['flag_dpa_consent'] = 'DPA consent should be checked.';
|
||||||
|
|
||||||
|
// check if email marketing promo is checked
|
||||||
|
$is_email_promo_checked = $req->request->get('flag_promo_email');
|
||||||
|
if ($is_email_promo_checked)
|
||||||
|
{
|
||||||
|
// check email field
|
||||||
|
if (empty($req->request->get('email')))
|
||||||
|
$error_array['email'] = 'Email address required.';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: validate mobile numbers
|
// TODO: validate mobile numbers
|
||||||
// TODO: validate vehicles
|
// TODO: validate vehicles
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
E-mail
|
E-mail
|
||||||
</label>
|
</label>
|
||||||
<input type="text" name="email" class="form-control m-input" value="{{ obj.getEmail }}" data-name="email">
|
<input type="text" name="email" class="form-control m-input" value="{{ obj.getEmail }}" data-name="email">
|
||||||
|
<div class="form-control-feedback hide" data-field="email"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group m-form__group row">
|
<div class="form-group m-form__group row">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue