Kentico CMS 7.0 Developer's Guide

Managing memberships

Managing memberships

Previous topic Next topic Mail us feedback on this topic!  

Managing memberships

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The management interface for memberships can be found in the Administration -> Membership section, both in CMS Desk and Site Manager.




Memberships can either be assigned to a specific site or defined as global objects that are available for all sites. In CMS Desk, only memberships that belong under the current site can be managed. When in Site Manager, you can select the site context using the Site drop‑down list at the top of the page. To access the list of all global memberships in the system, choose the (global) option.


It is possible to edit (Edit) or delete (Delete) the memberships displayed in the list. New memberships can be created for the selected site (or globally) by clicking NewMembership New membership. You can specify the following properties when adding a new membership:


Membership name - sets a name for the membership which is displayed in the administration interface.

Membership code name - sets a name that serves as an identifier for the membership.

Membership description - can be used to enter an optional text description for the membership.


There are four tabs available when editing (Edit) a membership:




On this tab you can edit the same properties that were specified when the membership was created.




This tab is used to define which roles the membership should contain. When the membership is assigned to a user, it will grant all permissions allowed by the specified roles until it expires.


To add roles, click the Add roles button and check the boxes next to the appropriate roles in the displayed selection dialog. Only roles that belong under the same site as the membership can be chosen (global memberships may only contain global roles). Roles can be removed from the membership at any time using the checkboxes in the list together with the Remove selected button.


If you need to add a role under multiple memberships, you can save time by navigating to Administration -> Roles and editing (Edit) the given role on its Memberships tab. Here you may easily assign it to any number of memberships using a single action.




Here you can view which users are assigned to the currently edited membership. For as long as their membership is valid, the listed users will be authorized to perform any actions allowed for the roles that the membership contains, as defined on the Roles tab.


Typically users will be added automatically when they purchase the membership as a product, so it is not necessary to manually assign them one by one. The purpose of this tab is to allow administrators to monitor the membership and override its settings if necessary.


If you wish to add users, click the Add users button and check the boxes next to the appropriate users in the displayed selection dialog.




Only users who are assigned to the same site as the membership can be chosen (global memberships may be assigned to all users in the system). You can enter a name or its part into the textbox above the list and click Search to quickly find any user. The Valid to field can be used together with the Calendar Calendar button to specify the exact date and time when the membership should expire for the given users. If this field is left empty, the users will be assigned to the membership for an unlimited time period. If you set an expiration date for the membership, you can also check the Send notification box to enable e‑mail reminders that will be sent to the selected users before the membership becomes invalid.


Click OK to apply any changes.




The Calendar Change validity action that is available for every listed user may be used to prolong or shorten the time interval for which the user should be assigned to the membership. This way you can set an expiration date or reactivate expired memberships for users.




This tab displays a list of products with which the membership is associated, as well as additional details. When purchased, these products assign the membership to the customer along with the authorization options that it provides. Membership as a type of product is described in the Product types -> Membership topic of the E-commerce Guide.


Setting memberships for users


It is also possible to directly manage the memberships of individual users via the administration interface in CMS Desk / Site Manager -> Administration -> Users. When editing a user, simply switch to the Membership tab where you can add or remove memberships to/from the user. Please note that global memberships can only be assigned by global administrators. Using the approach described above, you can set an expiration date for each of the memberships assigned to the user.




Displaying memberships on the live site


The My account web part from the Membership -> Logon & Registration category can be used to allow users to view a summary of their current memberships on the live site. If its Other tabs -> Display my membership property is enabled, the web part will display a list of all memberships assigned to the current user and their expiration dates.


The web part may also be configured using its Memberships -> Memberships page URL property to generate a link to a page where users can buy new memberships for the website or renew existing ones.


Membership expiration reminders


To help users keep track of their memberships and ensure that they know when it is necessary to renew a paid membership, the module includes an automatic notification feature.


There is a global scheduled task named Membership reminder that periodically checks memberships (once per day by default) and sends a notification e‑mail to users whose membership will expire within the amount of days specified by the Site Manager -> Settings -> Security & Membership -> Send Membership reminder (days) field. You can configure this task and setting as needed.




These reminders are only sent for memberships that were assigned with the Send notification flag enabled and for those that were purchased as a product with a limited duration. The content of the reminder e‑mails is taken from the Membership - Expiration notification e‑mail template, which can be edited via the Administration -> E‑mail templates interface.


When editing this e‑mail template, you can use the {% MembershipsTable %} context macro to insert a list of all memberships that will soon expire for the given user. This list must be formatted via a Text/ XML type transformation, which you can specify through the ApplyTransformation method, for example:




In addition to this special macro, you can also use all other standard macro expressions in the templates. See the Development -> Macro expressions chapter of this guide for more information about macro expressions in Kentico CMS.