ref #5858 feat: notification template

This commit is contained in:
Javier Segarra 2023-11-22 09:25:35 +01:00
parent 50cb7964d9
commit 1b60cd33d5
5 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,11 @@
const Stylesheet = require(`vn-print/core/stylesheet`);
const path = require('path');
const vnPrintPath = path.resolve('print');
module.exports = new Stylesheet([
`${vnPrintPath}/common/css/spacing.css`,
`${vnPrintPath}/common/css/misc.css`,
`${vnPrintPath}/common/css/layout.css`,
`${vnPrintPath}/common/css/email.css`])
.mergeStyles();

View File

@ -0,0 +1,2 @@
subject: Colisión de zona detectada
title: "La zona {0} ha sido registrada en más de un sitio"

View File

@ -0,0 +1,5 @@
SELECT
z.name
FROM vn.zoneIncluded zI
LEFT JOIN vn.zone z ON z.Id = zI.zoneFk
WHERE zI.id = ?;

View File

@ -0,0 +1,8 @@
<email-body v-bind="$props">
<div class="grid-row">
<div class="grid-block vn-pa-ml">
<h1>{{ $t('subject') }}</h1>
<p>{{ $t('title', [this.zoneIncluded.name]) }}</p>
</div>
</div>
</email-body>

View File

@ -0,0 +1,27 @@
const Component = require(`vn-print/core/component`);
const emailBody = new Component('email-body');
module.exports = {
name: 'zone-included',
async serverPrefetch() {
this.zoneIncluded = await this.fetchZoneIncluded(this.id);
},
methods: {
fetchZoneIncluded(id) {
return this.findOneFromDef('zoneIncluded', [id]);
},
},
components: {
'email-body': emailBody.build(),
},
props: {
id: {
type: Number,
required: true
},
url: {
type: String,
required: true
}
}
};