#1772 informe consumo campaña email template
gitea/salix/1772-campaign_metrics This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-11-22 16:01:11 +01:00
parent 6a153bd69d
commit 474e42c9bd
5 changed files with 104 additions and 0 deletions

View File

@ -0,0 +1,8 @@
const Stylesheet = require(`${appPath}/core/stylesheet`);
module.exports = new Stylesheet([
`${appPath}/common/css/spacing.css`,
`${appPath}/common/css/misc.css`,
`${appPath}/common/css/layout.css`,
`${appPath}/common/css/email.css`])
.mergeStyles();

View File

@ -0,0 +1,2 @@
[
]

View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html v-bind:lang="locale">
<head>
<meta name="viewport" content="width=device-width">
<meta name="format-detection" content="telephone=no">
<title>{{ $t('subject') }}</title>
</head>
<body>
<table class="grid">
<tbody>
<tr>
<td>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
<!-- Header block -->
<div class="grid-row">
<div class="grid-block">
<email-header v-bind="$props"></email-header>
</div>
</div>
<!-- Block -->
<div class="grid-row">
<div class="grid-block vn-pa-lg">
<h1>{{ $t('title') }}</h1>
<p>{{$t('dear')}},</p>
<p>{{$t('description')}}</p>
</div>
</div>
<!-- Footer block -->
<div class="grid-row">
<div class="grid-block">
<email-footer v-bind="$props"></email-footer>
</div>
</div>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,41 @@
const Component = require(`${appPath}/core/component`);
const emailHeader = new Component('email-header');
const emailFooter = new Component('email-footer');
module.exports = {
name: 'campaign-metrics',
async serverPrefetch() {
this.client = await this.fetchClient(this.clientId);
},
methods: {
// fetchClient(clientId) {
// return db.findOne(`
// SELECT
// c.id,
// u.name AS userName,
// CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
// w.phone AS salesPersonPhone,
// CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
// FROM client c
// JOIN account.user u ON u.id = c.id
// LEFT JOIN worker w ON w.id = c.salesPersonFk
// LEFT JOIN account.user wu ON wu.id = w.userFk
// WHERE c.id = ?`, [clientId]);
// },
},
components: {
'email-header': emailHeader.build(),
'email-footer': emailFooter.build()
},
props: {
clientId: {
required: true
},
from: {
required: true
},
to: {
required: true
}
}
};

View File

@ -0,0 +1,7 @@
subject: Informe consumo campaña
title: Informe consumo campaña
dear: Estimado cliente
description: Con motivo de esta próxima campaña, me complace
relacionarle a continuación el consumo que nos consta en su cuenta para las
mismas fechas del año pasado. Espero le sea de utilidad para preparar su pedido.
Al mismo tiempo aprovecho la ocasión para saludarle cordialmente.