server processing of new supervisor registration ready for testing

parent e724eebd
...@@ -161,7 +161,7 @@ module.exports = { ...@@ -161,7 +161,7 @@ module.exports = {
var message = sails.__({ var message = sails.__({
phrase: token.role + '_request', phrase: token.role + '_request',
locale: supervisor.lang locale: supervisor.lang
}, {name: supervisor.name + " " + supervisor.surname, email: supervisor: email}); }, {name: supervisor.name + " " + supervisor.surname, email: supervisor.email});
mailService.mailer() mailService.mailer()
.send({ .send({
...@@ -172,18 +172,30 @@ module.exports = { ...@@ -172,18 +172,30 @@ module.exports = {
.catch((err) => {}); .catch((err) => {});
return res.view('accountActivated', { return res.view('accountActivated', {
sup: supervisor, welcome_msg1: sails.__({
login_url: 'https://' + req.headers.host + '/app'}, phrase: 'welcome_msg1',
); locale: supervisor.lang
}, {name: supervisor.name}),
welcome_msg2: sails.__({
phrase: 'welcome_msg2',
locale: supervisor.lang
}, {login_url: 'https://' + req.headers.host + '/app'})
});
}) })
.catch((err) => { .catch((err) => {
return res.serverError("Office not found: " + err); return res.serverError("Office not found: " + err);
}); });
} else { // role is with no office, just return message } else { // role is with no office, just return message
return res.view('accountActivated', { return res.view('accountActivated', {
sup: supervisor, welcome_msg1: sails.__({
login_url: 'https://' + req.headers.host + '/app'}, phrase: 'welcome_msg1',
); locale: supervisor.lang
}, {name: supervisor.name}),
welcome_msg2: sails.__({
phrase: 'welcome_msg2',
locale: supervisor.lang
}, {login_url: 'https://' + req.headers.host + '/app'})
});
} }
}) })
.catch(function (err) { .catch(function (err) {
......
...@@ -5,5 +5,7 @@ ...@@ -5,5 +5,7 @@
"signin_mail": "To activate your Pictogram account, click on this link:\n", "signin_mail": "To activate your Pictogram account, click on this link:\n",
"change_password_mail": "To change your password, please click on the following link:\n", "change_password_mail": "To change your password, please click on the following link:\n",
"therapist_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as therapist to any of your students.", "therapist_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as therapist to any of your students.",
"tutor_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as tutor/father/mother to any of your students." "tutor_office_request": "{{ name }}, with email {{ email }}, is requesting to be linked as tutor/father/mother to any of your students.",
"welcome_msg1": "Welcome to Pictogram, {{ name }}!",
"welcome_msg2": "Your account is now active, so you can proceed to <a href=\"{{ login_url }}\">login</a>."
} }
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
"notification_from_pictogram": "Notificación desde Pictogram", "notification_from_pictogram": "Notificación desde Pictogram",
"signin_mail": "Para activar su cuenta en Pictogram, haga click en el siguiente enlace:\n", "signin_mail": "Para activar su cuenta en Pictogram, haga click en el siguiente enlace:\n",
"change_password_mail": "Para cambiar su contraseña, haga click en el siguiente enlace:\n", "change_password_mail": "Para cambiar su contraseña, haga click en el siguiente enlace:\n",
"welcome_message": "Su cuenta ha sido activada, puede ",
"welcome_title": "Bienvenido a Pictogram",
"login": "acceder", "login": "acceder",
"therapist_office_request {{ name }} {{ email }}": "El terapeuta {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante.", "therapist_office_request {{ name }} {{ email }}": "El terapeuta {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante.",
"tutor_office_request {{ name }} {{ email }}": "El tutor {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante." "tutor_office_request {{ name }} {{ email }}": "El tutor {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante.",
"welcome_msg1": "¡Bienvenido a Pictogram, {{ name }}!",
"welcome_msg2": "Su cuenta está ahora activa, por lo que puede <a href=\"{{ login_url }}\">acceder</a>."
} }
...@@ -10,13 +10,8 @@ ...@@ -10,13 +10,8 @@
<img title="Pictogram" alt="Pictogram" src="/app/img/logo_pictogram.png"> <img title="Pictogram" alt="Pictogram" src="/app/img/logo_pictogram.png">
<p><strong>Welcome to Pictogram, <%= sup.name %>!</strong></p> <p><strong>{{ welcome_msg1 }}</strong></p>
<p>Your account is now active, so you can proceed to <a href="<%= login_url %>">login</a>.</p> <p>{{ welcome_msg2 }}</p>
<p></p>
<p><strong>¡Bienvenido a Pictogram, <%= sup.name %>!</strong></p>
<p>Su cuenta está ahora activa, por lo que puede <a href="<%= login_url %>">acceder</a>.</p>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment