Add StatusCallback parameter - Twilio (#2801)

*  Add StatusCallback parameter

*  Fix type

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Ricardo Espinoza 2022-02-11 15:09:12 -05:00 committed by GitHub
parent 66acaade29
commit f43a38951c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,10 +151,25 @@ export class Twilio implements INodeType {
},
description: 'The message to send',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Field',
default: {},
options: [
{
displayName: 'Status Callback',
name: 'statusCallback',
type: 'string',
default: '',
description: 'Status Callbacks allow you to receive events related to the REST resources managed by Twilio: Rooms, Recordings and Compositions',
},
],
},
],
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: IDataObject[] = [];
@ -192,6 +207,7 @@ export class Twilio implements INodeType {
body.From = this.getNodeParameter('from', i) as string;
body.To = this.getNodeParameter('to', i) as string;
body.Body = this.getNodeParameter('message', i) as string;
body.StatusCallback = this.getNodeParameter('options.statusCallback', i, '') as string;
const toWhatsapp = this.getNodeParameter('toWhatsapp', i) as boolean;