I faced the same problem and solved it using libcontentaction. I wrote a blog post about how I solved it.