Subscribe.pm
NAME
Communiware::DE::Subscribe - Dynamic element Subscribe
SYNOPSIS
<:Subscribe parameters:>
DESCRIPTION
Dynamic element Subscribe allows to edit user's email subscriptions.
It should appear in form context.
If it appears in Post dynamic element context, then submit-time substitutions are allowed, so the user can be automatically subscribed to newly submitted item.
Note that this dynamic element wouldn't work correctly for anonymous users, so
anonymous user should be prevented from viewing this element unless it appears
inside posting form which would create PERSON
item for this user, and uses
submit-time substitution to get addressee value.
PARAMETERS
All parameters for <:Subscribe:>
have name=value
syntax.
- item
-
item to be subscribed to. This is typically current item of context expressed
as `
@ITEM_ID
' for visualisation-time substitution or `%ITEM_ID
' for submit-time substitution. (Typical subscriptions include new replics in discussion on this item, new articles in this rubric etc.) This argument is mandatory. - variant
-
Subscription variant, i.e. ID of the item (of type
DIGEST_VARIANT
) that describes what information will be posted. This argument is mandatory. - template
-
This is an ID of a digest template (item of type
DIGEST_TEMPLATE
) which would be used to generate digest for this item. See cmwmaild documentation for more information of requirements for mailing templates. - period
-
Frequency of sending announces. Possible values are:
HOURLY
,DAILY
,WEEKLY
,MONTHLY
andNEVER
. If this parameter is left empty, then popup menu of those values will be generated and default will be set for current value. Note that a value ofNEVER
means that corresponding entry inSUBSCRIPTION
table is absent or should absent. - format
-
Format of mail messages to send. Supported values are `
TEXT/PLAIN
' and `TEXT/HTML
'. If this field is left blank, menu of those values is displayed. Each user can have default value which is stored in cookie DEFAULT_FORMAT and is honoured by this dynamic element if the current user is the same as addressee. - addressee
-
List of recipients of this template. Defaults to current user. If not empty,
should be specified as valid Communiware filter specification i.e.
(ITEM_ID)
. -
Note that filter is executed at submit time, so if this element appears in the nested context, anything which should be substituted, should be substituted as parameters using visualisation time substitution.
-
Desired action would be performed on all these users.
- delimiter
- Value of a delimiter option would be used to separate two selects if both period and format are empty and could contain arbitrary HTML text.
Other parameters are used as attributes for generated <select> tags if any.
INTERNALS
handler
This function builds corresponding fragment on web page, that may consist entirely of hidden fields or include one or two selects for user-tunable period and format.
Names of this field have authomatically generated numeric prefix. Special
variable Subscribe
is used to pass list of this prefixes from page to the
handler. Variable __subscription_id
which exists only during page generation
is used to ensure uniqueness of ids.
BUGS
there is no documented method to update cached lists of periods or formats other than full restart of backend.