This commit is contained in:
parent
285fe67ca5
commit
dbf5953d69
|
@ -32,21 +32,23 @@ module.exports = Self => {
|
||||||
const userId = ctx.req.accessToken.userId;
|
const userId = ctx.req.accessToken.userId;
|
||||||
const emailUser =
|
const emailUser =
|
||||||
await Self.app.models.EmailUser.findById(userId, {fields: ['email']});
|
await Self.app.models.EmailUser.findById(userId, {fields: ['email']});
|
||||||
const {code, message, path, request, status, statusText, config: errConfig, name} = additionalData;
|
|
||||||
|
|
||||||
let html = `<h2>Motivo: ${reason}</h2>`;
|
let html = `<h2>Motivo: ${reason}</h2>`;
|
||||||
html += `<h3>Usuario: ${userId} ${emailUser.email}</h3>`;
|
html += `<h3>Usuario: ${userId} ${emailUser.email}</h3>`;
|
||||||
html += `<h3>Additional Data:</h3>`;
|
html += `<h3>Additional Data:</h3>`;
|
||||||
html += `<ul><li>Code: ${code}</li>`;
|
html += '<ul>';
|
||||||
html += `<li>Message: ${message}</li>`;
|
for (const [key, val] of Object.entries(additionalData)) {
|
||||||
html += `<li>Path: ${path}</li>`;
|
if (key !== 'config') html += `<li>${key}: ${parse(val)}</li>`;
|
||||||
html += `<li>Request: ${request}</li>`;
|
else {
|
||||||
html += `<li>Status: ${status}</li>`;
|
html += `<li>${key}:</li><ul style="list-style-type: square;">`;
|
||||||
html += `<li>StatusText: ${statusText}</li>`;
|
for (const [confKey, confVal] of Object.entries(val))
|
||||||
html += `<li>Config:</li><ul style="list-style-type: square;">`;
|
html += `<li>${confKey}: ${parse(confVal)}</li>`;
|
||||||
for (const [key, val] of Object.entries(errConfig)) html += `<li>${key}: ${parse(val)}</li>`;
|
html += '</ul>';
|
||||||
html += '</ul></ul>';
|
}
|
||||||
|
}
|
||||||
|
html += '</ul>';
|
||||||
|
|
||||||
|
const {message, path, name} = additionalData;
|
||||||
await smtp.send({
|
await smtp.send({
|
||||||
to: `${config.app.reportEmail}, ${emailUser.email}`,
|
to: `${config.app.reportEmail}, ${emailUser.email}`,
|
||||||
subject: `[Support-Salix] ${path} ${name}: ${message}`,
|
subject: `[Support-Salix] ${path} ${name}: ${message}`,
|
||||||
|
|
Loading…
Reference in New Issue