@@ -269,6 +269,93 @@ const ConfirmacionCambioCorreo = ({ apodo }) => {
269269 return { asunto, htmlContenido } ;
270270}
271271
272+ const _bloqueInfoDispositivo = ( nombre , sistemaOperativo , fecha ) => `
273+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin: 18px 0; background-color: #0b1120; border: 1px solid #1e293b; border-radius: 10px;">
274+ <tr>
275+ <td style="padding: 16px 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;">
276+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
277+ ${ nombre ? `<tr><td style="padding: 4px 0; border-bottom: 1px solid #1e293b;"><span style="color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.05em;">Dispositivo</span><br><strong style="color:#e2e8f0;font-size:14px;">${ nombre } </strong></td></tr>` : '' }
278+ ${ sistemaOperativo ? `<tr><td style="padding: 4px 0; border-bottom: 1px solid #1e293b;"><span style="color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.05em;">Sistema operativo</span><br><strong style="color:#e2e8f0;font-size:14px;">${ sistemaOperativo } </strong></td></tr>` : '' }
279+ <tr><td style="padding: 4px 0;"><span style="color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.05em;">Fecha y hora</span><br><strong style="color:#e2e8f0;font-size:14px;">${ fecha } </strong></td></tr>
280+ </table>
281+ </td>
282+ </tr>
283+ </table>` ;
284+
285+ const AvisoDispositivoConfianzaAnadido = ( { apodo, nombre, sistemaOperativo, fecha } ) => {
286+ const asunto = "Nuevo dispositivo de confianza añadido" ;
287+ const htmlContenido = BaseEmailWrapper ( `
288+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom: 20px; background-color: #052e16; border-left: 4px solid #22c55e; border-radius: 0 8px 8px 0;">
289+ <tr>
290+ <td style="padding: 14px 18px;">
291+ <h2 style="color: #22c55e; font-size: 17px; margin: 0 0 5px 0; font-weight: 700;">Dispositivo de confianza añadido</h2>
292+ <p style="margin: 0; color: #e2e8f0; font-size: 14px;">Un nuevo dispositivo ya puede iniciar sesión sin verificación.</p>
293+ </td>
294+ </tr>
295+ </table>
296+
297+ <p style="margin: 0 0 6px 0; font-size: 15px;">Hola, <strong style="color: #f8fafc;">${ apodo } </strong>.</p>
298+ <p style="margin: 0 0 4px 0; font-size: 14px; color: #94a3b8;">El siguiente dispositivo ha sido marcado como de confianza en tu cuenta:</p>
299+
300+ ${ _bloqueInfoDispositivo ( nombre , sistemaOperativo , fecha ) }
301+
302+ <p style="font-size: 13px; color: #64748b; line-height: 1.6; margin: 0;">
303+ <strong style="color: #ef4444;">¿No has sido tú?</strong> Accede a los ajustes de la aplicación, revoca la confianza de ese dispositivo y cambia tu contraseña de inmediato.
304+ </p>
305+ ` ) ;
306+ return { asunto, htmlContenido } ;
307+ } ;
308+
309+ const AvisoDispositivoConfianzaRevocado = ( { apodo, nombre, sistemaOperativo, fecha } ) => {
310+ const asunto = "Dispositivo de confianza eliminado" ;
311+ const htmlContenido = BaseEmailWrapper ( `
312+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom: 20px; background-color: #2c1502; border-left: 4px solid #f97316; border-radius: 0 8px 8px 0;">
313+ <tr>
314+ <td style="padding: 14px 18px;">
315+ <h2 style="color: #f97316; font-size: 17px; margin: 0 0 5px 0; font-weight: 700;">Confianza de dispositivo revocada</h2>
316+ <p style="margin: 0; color: #e2e8f0; font-size: 14px;">Un dispositivo ya no puede iniciar sesión sin verificación.</p>
317+ </td>
318+ </tr>
319+ </table>
320+
321+ <p style="margin: 0 0 6px 0; font-size: 15px;">Hola, <strong style="color: #f8fafc;">${ apodo } </strong>.</p>
322+ <p style="margin: 0 0 4px 0; font-size: 14px; color: #94a3b8;">El siguiente dispositivo necesitará verificación por correo en su próximo inicio de sesión:</p>
323+
324+ ${ _bloqueInfoDispositivo ( nombre , sistemaOperativo , fecha ) }
325+
326+ <p style="font-size: 13px; color: #64748b; line-height: 1.6; margin: 0;">
327+ Si has sido tú, puedes ignorar este mensaje.
328+ <strong style="color: #ef4444;">Si no reconoces esta acción</strong>, alguien tiene acceso a tu cuenta — cambia tu contraseña inmediatamente.
329+ </p>
330+ ` ) ;
331+ return { asunto, htmlContenido } ;
332+ } ;
333+
334+ const AvisoSesionCerrada = ( { apodo, nombre, sistemaOperativo, fecha } ) => {
335+ const asunto = "Sesión de dispositivo cerrada" ;
336+ const htmlContenido = BaseEmailWrapper ( `
337+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="margin-bottom: 20px; background-color: #1c0a2e; border-left: 4px solid #a855f7; border-radius: 0 8px 8px 0;">
338+ <tr>
339+ <td style="padding: 14px 18px;">
340+ <h2 style="color: #a855f7; font-size: 17px; margin: 0 0 5px 0; font-weight: 700;">Sesión cerrada remotamente</h2>
341+ <p style="margin: 0; color: #e2e8f0; font-size: 14px;">El acceso automático de un dispositivo ha sido eliminado.</p>
342+ </td>
343+ </tr>
344+ </table>
345+
346+ <p style="margin: 0 0 6px 0; font-size: 15px;">Hola, <strong style="color: #f8fafc;">${ apodo } </strong>.</p>
347+ <p style="margin: 0 0 4px 0; font-size: 14px; color: #94a3b8;">La sesión guardada del siguiente dispositivo ha sido eliminada. Necesitará credenciales completas para volver a entrar:</p>
348+
349+ ${ _bloqueInfoDispositivo ( nombre , sistemaOperativo , fecha ) }
350+
351+ <p style="font-size: 13px; color: #64748b; line-height: 1.6; margin: 0;">
352+ Si has sido tú, puedes ignorar este mensaje.
353+ <strong style="color: #ef4444;">Si no reconoces esta acción</strong>, cambia tu contraseña inmediatamente.
354+ </p>
355+ ` ) ;
356+ return { asunto, htmlContenido } ;
357+ } ;
358+
272359const ConfirmacionCambioApodo = ( { apodo } ) => {
273360 const asunto = "Apodo Actualizado"
274361 const htmlContenido = BaseEmailWrapper ( `
@@ -293,5 +380,8 @@ export {
293380 CodigoCambiarDatosCuenta ,
294381 ConfirmacionCambioContraseña ,
295382 ConfirmacionCambioCorreo ,
296- ConfirmacionCambioApodo
383+ ConfirmacionCambioApodo ,
384+ AvisoDispositivoConfianzaAnadido ,
385+ AvisoDispositivoConfianzaRevocado ,
386+ AvisoSesionCerrada
297387} ;
0 commit comments