Recently, a client of mine wanted to run a promotion on some of his online courses. He wanted to get users to signup, and then automatically enrolled to a certain course/courses:

The solution was relatively easy:

You can run the snippet straight, within another function or a function its own, as indicated above.