![]() |
Services | Software | Partners | Articles | Contact |
Usepoints Email: An example for the new Userpoints APIHere is an example module that demonstrates how to use the new Userpoints API, currently available in 4.7.x-2.x. This is a simple module that shows how a module can act on points gained/lost. The site admin define a threshold of points, if it is reached, then the user will get a custom email message. The message can be customized, for example, they can get a free gift or something like that. This module demonstrates the following:
To actually award points in a module, you need to call the function: userpoints_userpointsapi('points', $number_of_points, $uid, $event);The userpoints_basic.module (part of the standard userpoints 2.0 package) demonstrates how to award points, as well as provides points for the most common actions (posting a node, posting a comment, ...etc.) If your module provides a hook, i.e. uses module_invoke_all('modulename', ...) then you can award the points in that hook too.
|


message customization
How the message can be customized?
Feature request
Please create a feature request for the userpoints project on drupal.org to add a theme function. This will allow the message to be customized.
--
2bits -- Drupal consulting