XF 1.5 If new post contains (x) then (do y)

I'm looking for a way to access text from each new post/thread and if it contains specific strings, then a specific code is executed.

In the old vbulletin days, this was done via a post plugin with a newreply_post_start hook. The variable for the post text was $vbulletin->GPC['message'].

Does anyone know how to accomplish this in xenforo and what variable would be comparable to $vbulletin->GPC['message']? If not, maybe someone could point me in the right direction?

Thanks for your help.