See also: Writing Registry Plugins

Plugin Requirements

  1. The name of the Plugin should match the format FooConfirmer.
  2. The Plugin should implement a FooConfirmer model and a corresponding controller (FooConfirmersController).
  3. The Plugin must allow access to the reply action without authentication. This is typically done by adding $this->Auth→allow('reply'); to beforeFilter.
  4. The Plugin model must implement a willHandle function to determine whether or not it will handle a given request.
  5. The Plugin controller must implement a reply action to handle (and typically an associated view).

A sample Confirmer plugin is available in AvailablePlugin/TestConfirmer.

Overview

Confirmer Plugins operate at the platform, not CO level. When installed, they will be available to all COs. Although more than one Confirmer Plugin can be installed, only one Plugin can handle any given confirmation request. Plugins will be queried in alphabetical order until one indicates that it wants to handle the request. At that point, control is handed over to that Plugin and only that Plugin.

willHandle()

The Plugin must implement a decision function in the FooConfirmer model, with the following signature:

public function willHandle($coId, $coInvite, $coPetition)

where

  • coId: The ID of the CO associated with the invitation
  • coInvite: An array of information about the invitation, corresponding to cm_co_invites.
  • coPetition: An array of information about the petition (if any), corresponding to cm_co_petitions.

(info) The CO Person ID will generally be available in $coInvite['co_person_id'], and the Enrollment Flow ID (if applicable) will generally be available in $coPetition['co_enrollment_flow_id'].

Return Values

If the Plugin decides it wants to handle the request based on the information provided, it must return true, otherwise it must return false.

reply

If the Plugin indicated it wanted to handle the request, control is handed to the Plugin to perform whatever action it wants to, via the reply action. It is expected that the Plugin will provide links to the Enrollee to accept or decline the invitation, or automatically redirect to the accept or decline URLs as appropriate.

The entry point to the Confirmer Plugin will be /foo_confirmer/foo_confirmers/reply/inviteid.

To automatically generate confirmation buttons, add the following to the view file (reply.ctp):

include APP . DS . "View" . DS . "CoInvites" . DS . "buttons.inc";

The following PHP variables must be set to include buttons.inc:

  • $invite, holding the same information as was passed to willHandle() in $coInvite
  • $co_enrollment_flow, holding information about the relevant Enrollment Flow, if any
  • No labels