Proper template name

This commit is contained in:
Joan Sanchez 2023-03-15 08:07:14 +01:00
parent cd40705ecd
commit f052af92cd
1 changed files with 10 additions and 11 deletions

View File

@ -1,5 +1,3 @@
const {Email} = require('vn-print');
module.exports = Self => { module.exports = Self => {
Self.remoteMethodCtx('clientCreditEmail', { Self.remoteMethodCtx('clientCreditEmail', {
description: 'Sends the credit request email with an attached PDF', description: 'Sends the credit request email with an attached PDF',
@ -10,7 +8,7 @@ module.exports = Self => {
type: 'number', type: 'number',
required: true, required: true,
description: 'The client id', description: 'The client id',
http: {source: 'path'} http: {source: 'path'},
}, },
{ {
arg: 'recipient', arg: 'recipient',
@ -22,24 +20,25 @@ module.exports = Self => {
arg: 'replyTo', arg: 'replyTo',
type: 'string', type: 'string',
description: 'The sender email to reply to', description: 'The sender email to reply to',
required: false required: false,
}, },
{ {
arg: 'recipientId', arg: 'recipientId',
type: 'number', type: 'number',
description: 'The recipient id to send to the recipient preferred language', description:
required: false 'The recipient id to send to the recipient preferred language',
} required: false,
},
], ],
returns: { returns: {
type: ['object'], type: ['object'],
root: true root: true,
}, },
http: { http: {
path: '/:id/credit-request-email', path: '/:id/credit-request-email',
verb: 'POST' verb: 'POST',
} },
}); });
Self.clientCreditEmail = async ctx => Self.sendTemplate(ctx, 'client-welcome'); Self.clientCreditEmail = ctx => Self.sendTemplate(ctx, 'credit-request');
}; };