Source of file CommentsNotifications.php
Size: 1,002 Bytes - Last Modified: 2021-12-23T10:53:28+00:00
/var/www/docs.ssmods.com/process/src/code/CommentsNotifications.php
1234567891011121314151617181920212223242526272829303132333435 | <?php /** * Bootstrapping / configuration class for comments notification * * @author Damo */ class CommentsNotifications { public static function configure_siteconfig() { return Config::inst()->get('CommentsNotifications', 'recipient') === 'SiteConfig'; } public static function configure_page() { return Config::inst()->get('CommentsNotifications', 'recipient') === 'Page'; } /** * Returns the email address that should be notified of comments to the given page * * @param DataObject $parent Parent object * @return string Email address, if available */ public static function get_recipient($parent) { $recipient = Config::inst()->get('CommentsNotifications', 'recipient'); switch($recipient) { case 'Disabled': return null; case 'SiteConfig': return SiteConfig::current_site_config()->CommentNotificationEmail; case 'Page': return $parent->CommentNotificationEmail; case 'Admin': return Email::getAdminEmail(); default: return $recipient; } } } |