email.watermark undefined in inbound action

e_wilber
Tera Guru

Should you be able to use email.watermark in an inbound action? If so, what would cause it to display 'undefined' when trying to use it?

I do see a Ref:MSG## at the bottom of the email but email.watermark is not picking it up.

Update: I've used inbound actions countless times over the years without much problem. For this particular situation, the emails that appear to be failing the watermark are the emails that come in with like 5-10+ email replies since each outgoing email pushes out all the email communications. The email thread is pretty big on some of them which makes me think this is why the watermark at the very bottom of some of the emails aren't being processed correctly even though you can see them.

6 REPLIES 6

Michael Fry1
Kilo Patron

Doesn't the subject contain the ticket number? That should find the ticket regardless if watermark exists or not.




If you're using a custom email or your responses are all the same, like Please see ticket detail below, you can use the email properties below to strip out everything after that so the emails don't get so long:


Screen Shot 2017-06-13 at 10.51.31 AM.png


The email does contain the record number in the subject.



The tricky thing I had to accomplish (which is why I'm dealing with this issue) is we have many different types of email responses generated from our custom application. When each email is triggered, I record the watermark that SN gave that outgoing email and store it in a custom data lookup table. The data table holds the watermark and a choice field that records the type of email it was (customer, internal, etc).



When an email comes in, I need to get the watermark from the email so I can look it up in my custom table so I can put the data back into the proper notes field on my record.



It is not overly complicated but I need to be able to get the watermark in the inbound action so I can query my data table. The script is breaking when I try to use a regex to get the watermark:


var textMark = email.body_text.match(/Ref:MSG\d+/gi).toString();



It works for 99% of all emails but sometimes it fails, even though it's in there.


This is exactly what I am wanting to accomplish to. The watermark should hold the reference to the original email that was sent to the sender. That original email will be tied to a certain notification type.



That's disappointing there's not a built-in way of retrieving that.


Community Alums
Not applicable

Hi,

Your post was a long time ago, but I thought I'd answer it anyway. If you use \w instead of \d, that ought to work. \d will end at an underscore '_' and return a truncated value (if that was the problem).

Thanks,

Jason