portal_subcriptions is the central tool with the necessary methods
to query the subscriptions and execute them.
The subscriptions are looked up locally in a .cps_subscriptions folder in
the object.
Methods
|
|
|
|
__init__
|
__init__ ( self )
Initialization of default properties.
Core attributs and default messages contents
|
|
getAllSubscriptionsFor
|
getAllSubscriptionsFor (
self,
email=None,
context=None,
)
Returns all the subscriptions for a given member/email.
Catalog research. getRecipients is indexed for the subscriptions
container.
Notice, anonymous user can as well check their subscriptions.
|
|
getContainerPortalTypes
|
getContainerPortalTypes ( self )
Get all portal types in when we can set notifications
|
|
getDefaultMessageBody
|
getDefaultMessageBody ( self, event_id=None )
Returns the default event message title
If event_id then look for the current title that applied
to this given event.
|
|
getDefaultMessageTitle
|
getDefaultMessageTitle ( self, event_id=None )
Returns the default event message title.
If event_id then look for the current title that applied
to this given event.
|
|
getErrorMessageBody
|
getErrorMessageBody ( self, event_id=None )
Returns the error event message title
Used especially when the user edited the body of the event
but put wrong variable names.
If event_id is specified then let's check if we get a custom
one.
|
|
getEventsFromContext
|
getEventsFromContext ( self, context=None )
Returns events given a context.
|
|
getExplicitRecipientsRuleId
|
getExplicitRecipientsRuleId ( self )
Returns an in use id.
Id in use for the ExplicitRecipientsRule object
|
|
getMailNotificationRuleObjectId
|
getMailNotificationRuleObjectId ( self )
Returns an in use id.
Id in use for the MailNoticationRule object.
|
|
getRecipientsFor
|
getRecipientsFor (
self,
event_type='',
object=None,
infos={},
)
Get all the recipients computed from all the subscriptions
found. The black list parameter will pass within the infos parameter.
|
|
getRecordedEvents
|
getRecordedEvents ( self )
Returns recorded events
|
|
getSubscribeConfirmEmailBody
|
getSubscribeConfirmEmailBody ( self, event_id=None )
Returns the subcribe confirmation email body
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getSubscribeConfirmEmailTitle
|
getSubscribeConfirmEmailTitle ( self, event_id=None )
Returns the subcribe confirmation email title
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getSubscribeWelcomeEmailBody
|
getSubscribeWelcomeEmailBody ( self, event_id=None )
Returns the subcribe welcome email body
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getSubscribeWelcomeEmailTitle
|
getSubscribeWelcomeEmailTitle ( self, event_id=None )
Returns the subcribe welcome email title
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getSubscriptablePortalTypes
|
getSubscriptablePortalTypes ( self )
Returns the possible subscriptable portal types
|
|
getSubscriptionContainerFromContext
|
getSubscriptionContainerFromContext ( self, context )
Returns a subscriptions container id.
Lookup to find one through acquisition
|
|
getSubscriptionContainerId
|
getSubscriptionContainerId ( self )
Returns the default id for subscription containers
.cps_subscriptions by default
|
|
getSubscriptionsFor
|
getSubscriptionsFor (
self,
event_type,
object,
infos=None,
)
Get the subscriptions applicable for this event.
Some of the parameters may be None to get all subscriptions.
|
|
getUnSubscribeConfirmEmailBody
|
getUnSubscribeConfirmEmailBody ( self, event_id=None )
Returns the unsubcribe confirm email body
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getUnSubscribeConfirmEmailTitle
|
getUnSubscribeConfirmEmailTitle ( self, event_id=None )
Returns the unsubcribe confirm email title
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getUnSubscribeEmailBody
|
getUnSubscribeEmailBody ( self, event_id=None )
Returns the unsubcribe email body
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
getUnSubscribeEmailTitle
|
getUnSubscribeEmailTitle ( self, event_id=None )
Returns the unsubcribe email title
If event_id is specified then let's check if we get a custom
one for the given event.
|
|
isSubscriberFor
|
isSubscriberFor (
self,
event_id,
context,
email='',
role_based=0,
)
Is a given member subscriber for a given email in the given context
|
|
manage_addEventType
|
manage_addEventType (
self,
event_where,
event_id,
event_label,
REQUEST=None,
)
Adds a new event id in a given context
|
|
manage_editDefaultEventMessage
|
manage_editDefaultEventMessage (
self,
event_default_email_title,
event_default_email_body,
event_error_email_body,
subscribe_confirm_email_body,
subscribe_confirm_email_title,
subscribe_welcome_email_body,
subscribe_welcome_email_title,
unsubscribe_email_title,
unsubscribe_email_body,
unsubscribe_confirm_email_title,
unsubscribe_confirm_email_body,
REQUEST=None,
)
Edit the default event email
|
|
manage_editEventMessage
|
manage_editEventMessage (
self,
event_id,
event_email_title,
event_email_body,
subscribe_confirm_email_body='',
subscribe_confirm_email_title='',
subscribe_welcome_email_body='',
subscribe_welcome_email_title='',
unsubscribe_email_title='',
unsubscribe_email_body='',
unsubscribe_confirm_email_title='',
unsubscribe_confirm_email_body='',
REQUEST=None,
)
Edit a custom event message
|
|
notify_event
|
notify_event (
self,
event_type,
object,
infos,
)
Standard event hook.
Get the applicable subscriptions. Sends the event to the
subscriptions.
For workflow events, infos must contain the additional
keyword arguments passed to the transition.
|