modifica mensajes del registro y el envio de correo

This commit is contained in:
Germán Correa 2021-06-17 18:01:52 -03:00
parent 8142d51b39
commit 1f9193eee3

View File

@ -200,7 +200,7 @@ $app->group('/api', function($app){
//ReCaptcha Validation
if(!isset($data['g-recaptcha-response'])||empty($data['g-recaptcha-response'])){
$messages->addMessageNow("submit-register-err", "Please validate captcha!");
$messages->addMessageNow("submit-register-err", "Debe validar el ReCaptcha!");
}
else {
$recapsecret = $this->settings['recaptcha']['secret'];
@ -212,7 +212,7 @@ $app->group('/api', function($app){
//get remote ip from request header TODO
$resp = $recaptcha->verify($data['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if(!$resp->isSuccess()){
$messages->addMessageNow("submit-register-err", "ReCaptcha validation error " . implode($resp->getErrorCodes()));
$messages->addMessageNow("submit-register-err", "Error de validación de ReCaptcha " . implode($resp->getErrorCodes()));
}
else {
unset($data['g-recaptcha-response']);
@ -243,18 +243,18 @@ $app->group('/api', function($app){
$messages->addMessageNow("submit-register-err", "DB error: ".$e->getMessage());
}
$arrayresponse = array("success" => true,
"msg"=>"You have been successfully registered to Workshop on Surface Dynamics 2018",
"msg"=>"Su registro al CLAM2021 ha sido satisfactorio.",
"data"=>$data);
/*$mailbody = "Hello ".$data["nombre"]." ".$data["apellido"].",\n\n".
"You have been successfully registered to the Workshop on Surface Dynamics 2018!\n\n".
"If you need to change the information you have provided and for any ".
"questions please contact surfacedynamics2018@cmat.edu.uy\n\n".
"Best!\n\n";
$headers = 'From: ' . "surfacedynamics2018@cmat.edu.uy" . "\r\n" .
'Reply-To: ' . "surfacedynamics2018@edu.uy" . "\r\n" .
$mailbody = "Hola ".$data["nombre"]." ".$data["apellido"].",\n\n".
"Se ha inscripto satisfactoriamente al CLAM2021!\n\n".
"Por cualquier consulta no dude en contactar al comité organizador en: ".
"clam2021@fing.edu.uy\n\n".
"Saludos Cordiales!\n\n";
$headers = 'From: ' . "clam2021@fing.edu.uy" . "\r\n" .
'Reply-To: ' . "clam2021@fing.edu.uy" . "\r\n" .
'Content-Type: ' . "text/plain; charset=UTF-8". "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($data['email'], 'Successfully registered to the Surface Dynamics 2018 Workshop', $mailbody, $headers);*/
mail($data['email'], 'Registro exitoso CLAM2021', $mailbody, $headers);*/
}
$newres = $response->withJson($arrayresponse);
return $newres;