IBM / smart-email-support

Smart Email Support for Telecom Organisations - Provide automated customer support for emails
https://developer.ibm.com/patterns/email-support-automation-for-telco/
Apache License 2.0
21 stars 13 forks source link

"TypeError: Cannot read property 'match' of null" on both the cloudant nodes #3

Closed threecubet closed 3 years ago

threecubet commented 5 years ago

node-red

When i send an email the node reads the payload and execute the function but when the payload and from address is passed to the cloudant node i get a response like

TypeError: Cannot read property 'match' of null

muralidharchavan commented 5 years ago

Can you double click the "AddFromEMailToPayload" node and provide the contents pls?

threecubet commented 5 years ago

msg.temppayload = msg.payload msg.payload = msg.header.from.value[0].address return msg; this is what the content is

muralidharchavan commented 5 years ago

Looks like msg.header.from.value[0].address is null. Please confirm what is the value of msg.header.from.value[0].address.

threecubet commented 5 years ago

In the above image. In the debug tab the second object description shows the response from the function

from: object value: array[1] 0: object address: "akhil.raj@cubettech.com"

muralidharchavan commented 5 years ago

Is the cloudant database, customer_data, populated with the email id "akhil.raj@gmail.com" as _id?

threecubet commented 5 years ago

yes it is

threecubet commented 5 years ago

I get this error whenever i deploy the flow even before sending an email.

muralidharchavan commented 5 years ago

Ok. What happens if you ignore the error and then send an email. Do you still get that error?

threecubet commented 5 years ago

ya it wont work, shows up with the same issue

muralidharchavan commented 5 years ago

Ok, just to eliminate Cloudant database issue, can I suggest you to inject your own text, instead of email, and then check if data is getting updated in Cloudant DB? Let's narrow down if Cloudant is causing the issue here.

muralidharchavan commented 4 years ago

Hi. Were you able to resolve this issue? An alternate option to fix this issue is to use cloudant database that was created as part of node-red service.