refs #5410 feat: envia email cuando se añade una nota
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-03-21 14:53:36 +01:00
parent 98916bf5e1
commit 41c79263c4
2 changed files with 28 additions and 2 deletions

View File

@ -123,11 +123,33 @@ export default class Controller extends Section {
}
this.$http.post(`ClientObservations`, params) .then(() => {
this.vnApp.showMessage(this.$t('Observation saved!'));
this.vnApp.showSuccess(this.$t('Observation saved!'));
this.sendMail();
this.$state.reload();
});
}
sendMail() {
const params = [];
for (let defaulter of this.checked) {
const body = this.$t('Added observation', {
salesPersonName: defaulter.salesPersonName,
text: this.defaulter.observation
});
params.push({
subject: this.$t('Comment added to client', {clientFk: defaulter.clientFk}),
body: body,
receiver: `${defaulter.salesPersonName}@verdnatura.es`,
replyTo: `${window.localStorage.lastUser}@verdnatura.es`
});
}
this.$http.post(`Mails`, params) .then(() => {
this.vnApp.showMessage(this.$t('Email sended!'));
});
}
exprBuilder(param, value) {
switch (param) {
case 'creditInsurance':

View File

@ -7,3 +7,7 @@ L. O. Date: Fecha Ú. O.
Last observation date: Fecha última observación
Search client: Buscar clientes
Worker who made the last observation: Trabajador que ha realizado la última observación
Added observation: '{{salesPersonName}} añadió esta observacion: {{text}}'
Comment added to client: Observación añadida al cliente {{clientFk}}
Email sended!: Email enviado!
Observation saved!: Observación añadida!