salix/modules/travel/back/methods/travel/extraCommunityEmail.js

77 lines
2.0 KiB
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('extraCommunityEmail', {
description: 'Sends the extra community email with an attached PDF',
accessType: 'WRITE',
accepts: [
{
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: 'landedTo',
type: 'date'
},
{
arg: 'shippedFrom',
type: 'date'
},
{
arg: 'continent',
type: 'string'
},
{
arg: 'reference',
type: 'string'
},
{
arg: 'id',
type: 'number'
},
{
arg: 'agencyModeFk',
type: 'number'
},
{
arg: 'warehouseOutFk',
type: 'number'
},
{
arg: 'warehouseInFk',
type: 'number'
},
{
arg: 'totalEntries',
type: 'number'
},
{
arg: 'cargoSupplierFk',
type: 'number'
}
],
returns: {
type: ['object'],
root: true
},
http: {
path: '/extra-community-email',
verb: 'POST'
}
});
Self.extraCommunityEmail = ctx => Self.sendTemplate(ctx, 'extra-community');
};