ilateral\SilverStripe\Notifier\Types\NotificationType
Base Object for sending notifications
Synopsis
class NotificationType
extends DataObject
{
- // members
- private static string $table_name = 'Notifications_NotificationType';
- private static $template;
- private static $allowed_objects;
- private static array $alt_from_fields = ;
- private static array $alt_recipient_fields = ;
- protected DataObject $object;
- protected array $extra_vars = ;
- private static array $db = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static array $summary_fields = ;
- private static array $field_labels = ;
- // methods
- public void getType()
- public string getSummary()
- public string getRenderedContent()
- protected array getAltFromFields()
- protected array getAltRecipientFields()
- protected array getRecipients()
- protected string getSender()
- protected void getFieldsFromClass()
- protected array compilePossibleTemplateVars()
- protected string getRenderedTemplateVars()
- public void getCMSFields()
- public ValidationResult validate()
- public void send()
- public DataObject getObject()
- public NotificationType setObject()
- protected string renderString()
- public array getExtraVars()
- public NotificationType setExtraVars()
- public NotificationType addExtraVar()
- public NotificationType removeExtraVar()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
-
$allowed_objects
List of objects that this notification is allowed to send to. If null, then all notifications can be sent to all registered objects - $alt_from_fields
—
array
Alternate fields on an object that can be used for the from field on this notification. Provided in the format of the classname as the key and an array of field names as the value. - $alt_recipient_fields
—
array
Alternate fields on an object that can be used for the recipient field on this notification. Provided in the format of the classname as the key and an array of field names as the value. - $casting
- $db
- $field_labels
- $has_one
- $summary_fields
- $table_name
- $template
—
string
Template used for rendering this notification
protected
- $extra_vars
—
array
Extra vars to be used when rendering - $object
—
SilverStripe\ORM\DataObject
The current object instance that is notifying
Methods
protected
- compilePossibleTemplateVars() — Attempt to generate a list possible template variables that can be used in the subject and content fields.
- getAltFromFields() — Get a list of possible alternate fields that can be used for the from address
- getAltRecipientFields() — Get a list of possible alternate fields that can be used for the recipient address
- getFieldsFromClass()
- getRecipients() — Get a list of recipients to recieve this notification.
- getRenderedTemplateVars() — Generate a string of possible template vars
- getSender() — Try and find the correct default sender
- renderString() — Take the passed string and render it using SSViewer
public
- addExtraVar() — Add a variable to be used when rendering
- getCMSFields()
- getExtraVars() — Get extra vars to be used when rendering
- getObject() — Get the current object instance that is notifying
- getRenderedContent() — Return a rendered version of this notification's content using the current object as a base
- getSummary() — Attempt to generate a summary of this rule
- getType()
- removeExtraVar() — Remove a variable to be used when rendering
- send()
- setExtraVars() — Set extra vars to be used when rendering
- setObject() — Set the current object instance that is notifying
- validate() — Ensure that a sender and recipient are set