regex in Voice Notification

POP Peeper: Tech support, suggestions, discussion, etc.
Post Reply
Mighty
Posts: 7
Joined: Thu May 06, 2010 5:14 pm

regex in Voice Notification

Post by Mighty »

I'm kind of liking the new voice notification. Albeit, I had to search for a while to find an alternate voice. Microsoft has put almost zero support into that.

Anyway. My request is for regular expression support in voice notification substitutions. My current example is Amazon order and shipping notices. I have no need for the voice notification to read me the entire 15-digit order number. Since each number is unique, I can't filter it out with the current substitution system. I would prefer that it collapse the entire thing down to, "Amazon order placed." or, "Amazon order shipped." If I'm anxious about a particular item, then I can look at the email in my browser to get more information.

For my use, I mostly want to just chop off portions of the subject before it's fed to the voice module. I suppose other people might want to rearrange, and mix and match pieces of the subject. So, full regex support would be necessary for that.

Drake Christensen
User avatar
Jeff
Admin / Developer
Posts: 9234
Joined: Sat Sep 08, 2001 9:46 pm

Re: regex in Voice Notification

Post by Jeff »

There is simple wildcard and I've created several substitutions that perform a similar function, so you can probably already do what you want.

(bug found: make sure you read this entire post before starting)

For example, let's say you get an email from "Amazon" and the subject contains the word "order", you could use the following substitution:
%amazon*order% = [Order from amazon]

The result would be that voice notifier will say "order from amazon." You can include the account, if necessary:
%amazon*order% = [Order from amazon on %act%]

For shipped items, you will need to put this syntax *above* the first one, since they are processed in order, and the above one would probably catch a "shipped" time:
%amazon*shipped% = [Order shipped from amazon on %act%]


BUG:
Ok, I was getting some weird results when I started testing this and things aren't working like I expected them to. The problem is that when the right-side is enclosed in [...], it's supposed to indicate that the entire syntax should be replaced. But this doesn't work when using the wildcard syntax on the left-side in the current version. Presently, it will only replace the wildcard match; so if the original voice would have said:
New message, on [accountname] . From Amazon.com . Your Amazon.com order of "whatever" has shipped!
the above substitution would say:
New message, on [accountname] . From Order shipped from amazon on [accountname]!
instead of:
Order shipped from amazon on [accountname]

This has been fixed for v4.1. You can probably still get it to do what you want with the current version, but it might be best to way.

As a quick example, if you used this syntax:
%from amazon*shipped% = Order shipped from amazon
would result in
New message, on [accountname] . Order shipped from amazon
Post Reply