Parker Software Ltd Homepage
Forum Home Forum Home > Email2DB Email Parser > Scripting
  New Posts New Posts RSS Feed: Define keyword with conditional script
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Define keyword with conditional script

 Post Reply Post Reply
Author
Message
cardman View Drop Down
New User
New User


Joined: 18 Feb 2010
Posts: 9
Post Options Post Options   Quote cardman Quote  Post ReplyReply Direct Link To This Post Topic: Define keyword with conditional script
    Posted: 14 Mar 2010 at 2:34pm
Hi,

is it possible to define a keyword with conditional script?
Case: Each message body starts with specified keyword. Script should proof (and process if matched) only the first word of the message (keyword).

This built-in conditional function is not useful while it is possible that some keywords exists in the middle of message and this is not what I need. Only the first word should be matched.

For an example, I would be grateful

cardman
Back to Top
Stephen View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 Oct 2005
Location: Stoke on Trent
Posts: 1131
Post Options Post Options   Quote Stephen Quote  Post ReplyReply Direct Link To This Post Posted: 15 Mar 2010 at 10:12am

You can create an Email2DB field to extract the first word of the body.

Set the Look For to '*'.
Set the Extract until 'Any Of These Characters' option
Move the field to first in the list of fields.
 
You can then use this field value in any of Email2Db actions using %fieldname%. Or use in Email2DB scripts using FIELD_Value("Fieldname")
 
For a condition script you could do:
 

Sub Main
Select Case FIELDS_Value("FirstWord")
Case "word1","word2"
   Email2DBSend = True
Case Else
   Email2DBSend = False
End Select
End Sub
 
Steve
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.109 seconds.
These are the forums for Parker Software, developers of Live Chat Software: WhosOn and Email Automation Software: Email2DB.