Today we are going to learn a few neat tricks that we can do when using Pay Per View and the MS Drip Content modules together.
Pay Per View allows us to sell and restrict access to individual nodes (or even fields inside of nodes) without simply denying access like most other Access Control modules out there. Instead of an Access Denied page, the user is shown a configurable 'teaser' if they do not have access to the node they are viewing.
MS Drip Content allows us to set up 'Drip Sets' which consist of rules that are triggered X days after the set starts. The possibilities for this module really are endless, since it integrates with Rules and allows you to literally perform any action at a set time for a user.
Today's Goal
Here's the situation. We are trying to build a site where members who have bought a membership (we will be using Membership Suite for that) will be scheduled to receive sequential weekly access to new content for an example Training Program. The Training Program will be for users who are learning how to play Piano, just to use an example. So when the user signs up, they get the first week's content automatically. Then once a week has gone by, they receive the next lesson, and so on. We will have 5 lessons in the set.
The Set Up
In order to get this to work, we will be using the following modules:
Once we have those modules installed and we have set up a Membership Plan that we wish the user to purchase (see How to use Membership Suite here), we are ready to set up the Piano Lessons.
1. Set Up Content Type
First, we create a new Content Type called 'Lesson'. The important thing is that we set the Pay Per View settings on the Content Type so that it will be 'protected' (users have to have access before they can view it). We don't really want the users to be able to pay to see the content early, but that is certainly possible using Pay Per View. But for this example we won't be using the payment links or amount in the Teaser. We will simply say "We are sorry, you don't yet have access to this content.".
2. Pay Per View Settings
We don't actually want to sell access to this content, but we still need to set a price so it isn't free and we need to make sure the protected content message is configured.
3. Set up the Drip Set
Once that is set up and we have added a few Piano Lessons, we are ready to set up the Drip Set. Go to the Drip Sets page and add a new Drip Set. You can call this Drip Set whatever you wish. I'm calling mine Piano Course. The Unsubscribe User at the End option simply means that after the last item is fired, should the user be unsubscribed from the set? If you add items later and the user is not unsubscribed, they will get the new items still.
4. Drip Set Items
Now that we have a Drip Set, we need to add Drip Items to it. I want to add one for the very start that will release the first week's content, as well as send an email to the user with the link. So let's add a Drip Item and set the Days field to 0. Once the Drip Item has been created, we can now use Rules to add actions to it. Click the Rule for the item to add as many actions to the item as you want.
5. Add Actions to Drip Set Item
For this example, we add the following actions: Send Mail to user informing them of the new content. Fetch entity by id to load the node object that is being released. Add the Pay Per View access to the user so they can view the content.
6. Load Entity By ID
It is necessary to load the node entity by ID in order to add access to the node for that user. For this reason, we will first add an action to load the entity by it's ID. The ID is the nid of the node. You can find it by hovering over the Edit link of the Node in the Content page.
7. Set up the Email
We are just sending an email to the account:mail and including a link to the new content.
8. Set up the Rule to Start the Drip Set
Finally, we need to create a Rule to start the Piano Course Drip Set when the user Signs up for a Membership.
It is very simple to set up this rule, we just check that the Plan is the one we want, and we start the Drip Set for the account.
9. Test First Drip Item
To test, we purchase a membership and then run cron to see if the first Drip Item was run for the user. The email was successfully sent to the user for the first Drip Item when they sign up for the membership, and the access was granted. Success!
Conclusion
Following this pattern you can easily set up Lesson/Course sites, as well as Learning Modules. You can also set up any other kind of timed-release system, where the users should be drip fed the content over a course of time. I hope this tutorial was helpful!
Video Tutorial
For those who like to watch a video, here is the screencast of this Tutorial:



















Comments
thx
dear leighton,
thank you very much for this tutorial. it is very helpful.....
best regards
helmut eder