salix/modules/client/back/methods/client/letterDebtorStEmail.js

50 lines
1.4 KiB
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('letterDebtorStEmail', {
description: 'Sends the printer setup email with an attached PDF',
accessType: 'WRITE',
accepts: [
{
arg: 'id',
type: 'number',
required: true,
description: 'The client id',
http: {source: 'path'}
},
{
arg: 'recipient',
type: 'string',
description: 'The recipient email',
required: true,
},
{
arg: 'replyTo',
type: 'string',
description: 'The sender email to reply to',
required: false
},
{
arg: 'recipientId',
type: 'number',
description: 'The recipient id to send to the recipient preferred language',
required: false
},
{
arg: 'companyId',
type: 'number',
description: 'The company id',
required: true
}
],
returns: {
type: ['object'],
root: true
},
http: {
path: '/:id/letter-debtor-st-email',
verb: 'POST'
}
});
Self.letterDebtorStEmail = ctx => Self.sendTemplate(ctx, 'letter-debtor-st');
};