File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -468,25 +468,25 @@ protected function setEmail(): void
468468 // cargamos los datos por defecto del modelo
469469 $ this ->loadDataDefault ($ model );
470470
471- if ($ model ->hasColumn ('email ' ) && Validator::email ($ model ->email )) {
471+ if ($ model ->hasColumn ('email ' ) && ! empty ( $ model -> email ) && Validator::email ($ model ->email )) {
472472 $ this ->newMail ->to ($ model ->email );
473473 return ;
474474 }
475475
476476 $ proveedor = new Proveedor ();
477- if ($ model ->hasColumn ('codproveedor ' ) && $ proveedor ->load ($ model ->codproveedor ) && Validator::email ($ proveedor ->email )) {
477+ if ($ model ->hasColumn ('codproveedor ' ) && $ proveedor ->load ($ model ->codproveedor ) && ! empty ( $ proveedor -> email ) && Validator::email ($ proveedor ->email )) {
478478 $ this ->newMail ->to ($ proveedor ->email , $ proveedor ->razonsocial );
479479 return ;
480480 }
481481
482482 $ contact = new Contacto ();
483- if ($ model ->hasColumn ('idcontactofact ' ) && $ contact ->load ($ model ->idcontactofact ) && Validator::email ($ contact ->email )) {
483+ if ($ model ->hasColumn ('idcontactofact ' ) && $ contact ->load ($ model ->idcontactofact ) && ! empty ( $ contact -> email ) && Validator::email ($ contact ->email )) {
484484 $ this ->newMail ->to ($ contact ->email , $ contact ->fullName ());
485485 return ;
486486 }
487487
488488 $ cliente = new Cliente ();
489- if ($ model ->hasColumn ('codcliente ' ) && $ cliente ->load ($ model ->codcliente ) && Validator::email ($ cliente ->email )) {
489+ if ($ model ->hasColumn ('codcliente ' ) && $ cliente ->load ($ model ->codcliente ) && ! empty ( $ cliente -> email ) && Validator::email ($ cliente ->email )) {
490490 $ this ->newMail ->to ($ cliente ->email , $ cliente ->razonsocial );
491491 }
492492 }
You can’t perform that action at this time.
0 commit comments