I read the udf and it looks easy to use. I am not quite sure how to code the rest of the script. Should I do something like

if $eventlog = 'system' and $eventid = '36'
else
endif

mail
etc?