From 474e42c9bd7d984bd9f112f153152e58616b3d5c Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 22 Nov 2019 16:01:11 +0100 Subject: [PATCH] =?UTF-8?q?#1772=20informe=20consumo=20campa=C3=B1a=20emai?= =?UTF-8?q?l=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../campaign-metrics/assets/css/import.js | 8 ++++ .../email/campaign-metrics/attachments.json | 2 + .../campaign-metrics/campaign-metrics.html | 46 +++++++++++++++++++ .../campaign-metrics/campaign-metrics.js | 41 +++++++++++++++++ .../email/campaign-metrics/locale/es.yml | 7 +++ 5 files changed, 104 insertions(+) create mode 100644 print/templates/email/campaign-metrics/assets/css/import.js create mode 100644 print/templates/email/campaign-metrics/attachments.json create mode 100644 print/templates/email/campaign-metrics/campaign-metrics.html create mode 100755 print/templates/email/campaign-metrics/campaign-metrics.js create mode 100644 print/templates/email/campaign-metrics/locale/es.yml diff --git a/print/templates/email/campaign-metrics/assets/css/import.js b/print/templates/email/campaign-metrics/assets/css/import.js new file mode 100644 index 000000000..b44d6bd37 --- /dev/null +++ b/print/templates/email/campaign-metrics/assets/css/import.js @@ -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(); diff --git a/print/templates/email/campaign-metrics/attachments.json b/print/templates/email/campaign-metrics/attachments.json new file mode 100644 index 000000000..32960f8ce --- /dev/null +++ b/print/templates/email/campaign-metrics/attachments.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/print/templates/email/campaign-metrics/campaign-metrics.html b/print/templates/email/campaign-metrics/campaign-metrics.html new file mode 100644 index 000000000..238d80d4a --- /dev/null +++ b/print/templates/email/campaign-metrics/campaign-metrics.html @@ -0,0 +1,46 @@ + + + + + + {{ $t('subject') }} + + + + + + + + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+

{{ $t('title') }}

+

{{$t('dear')}},

+

{{$t('description')}}

+
+
+ +
+
+ +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/print/templates/email/campaign-metrics/campaign-metrics.js b/print/templates/email/campaign-metrics/campaign-metrics.js new file mode 100755 index 000000000..f2104d825 --- /dev/null +++ b/print/templates/email/campaign-metrics/campaign-metrics.js @@ -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 + } + } +}; diff --git a/print/templates/email/campaign-metrics/locale/es.yml b/print/templates/email/campaign-metrics/locale/es.yml new file mode 100644 index 000000000..e662ca614 --- /dev/null +++ b/print/templates/email/campaign-metrics/locale/es.yml @@ -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.