refs #5410 feat: envia email cuando se añade una nota
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
98916bf5e1
commit
41c79263c4
|
@ -123,11 +123,33 @@ export default class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$http.post(`ClientObservations`, params) .then(() => {
|
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();
|
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) {
|
exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'creditInsurance':
|
case 'creditInsurance':
|
||||||
|
|
|
@ -7,3 +7,7 @@ L. O. Date: Fecha Ú. O.
|
||||||
Last observation date: Fecha última observación
|
Last observation date: Fecha última observación
|
||||||
Search client: Buscar clientes
|
Search client: Buscar clientes
|
||||||
Worker who made the last observation: Trabajador que ha realizado la última observación
|
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!
|
||||||
|
|
Loading…
Reference in New Issue