public function init() { // Add the postChannel activity type. ET::activityModel(); ETActivityModel::addType("postChannel", array("notification" => array(__CLASS__, "postChannelNotification"), "email" => array(__CLASS__, "postChannelEmail"))); ET::define("email.postChannel.body", "<p><strong>%1\$s</strong> has posted in a conversation in a channel which you followed: <strong>%2\$s</strong></p><hr>%3\$s<hr><p>To view the new activity, check out the following link:<br>%4\$s</p>"); ET::define("email.postChannel.subject", "[%1\$s] %2\$s"); }
public function init() { // Add the postMember activity type. ET::activityModel(); ETActivityModel::addType("postMember", array("notification" => array(__CLASS__, "postMemberNotification"), "email" => array(__CLASS__, "postMemberEmail"))); // Define the postMember email language text. ET::define("email.postMember.body", "<p><strong>%1\$s</strong> has posted in a conversation: <strong>%2\$s</strong></p><hr>%3\$s<hr><p>To view the new activity, check out the following link:<br>%4\$s</p>"); ET::define("email.postMember.subject", "There is a new post by %1\$s"); }
* Returns a formatted notification item for the "updateAvailable" activity type. * * @see postNotification() for parameter and return information. */ public static function updateAvailableNotification($item) { return array("<i class='icon-wrench'></i> " . sprintf(T("A new version of esoTalk (%s) is available."), "<strong>" . $item["data"]["version"] . "</strong>"), !empty($item["data"]["releaseNotes"]) ? $item["data"]["releaseNotes"] : "http://esotalk.org/"); } /** * Returns a formatted notification item for the "unapproved" activity type. * * @see postNotification() for parameter and return information. */ public static function unapprovedNotification($item) { return array("<i class='icon-user'></i> " . sprintf(T("%s has registered and is awaiting approval."), "<strong>" . name($item["data"]["username"]) . "</strong>"), URL("admin/unapproved")); } } // Add default activity types. ETActivityModel::addType("post", array("notification" => array("ETActivityModel", "postNotification"), "email" => array("ETActivityModel", "postEmail"))); ETActivityModel::addType("postActivity", array("activity" => array("ETActivityModel", "postActivity"))); ETActivityModel::addType("groupChange", array("activity" => array("ETActivityModel", "groupChangeActivity"), "notification" => array("ETActivityModel", "groupChangeNotification"))); ETActivityModel::addType("mention", array("notification" => array("ETActivityModel", "mentionNotification"), "email" => array("ETActivityModel", "mentionEmail"))); ETActivityModel::addType("join", array("activity" => array("ETActivityModel", "joinActivity"))); // Define an email to send out when a member is added to a private conversation. ETActivityModel::addType("privateAdd", array("notification" => array("ETActivityModel", "privateAddNotification"), "email" => array("ETActivityModel", "privateAddEmail"))); // Notification for when an update to the esoTalk software is available. ETActivityModel::addType("updateAvailable", array("notification" => array("ETActivityModel", "updateAvailableNotification"))); // Notification for when a new user signs up and needs approval. ETActivityModel::addType("unapproved", array("notification" => array("ETActivityModel", "unapprovedNotification")));
/** * Returns a formatted email subject+body for the "post" activity type. * * @see mentionEmail() for parameter and return information. */ public static function postEmail($item, $member) { $content = ET::formatter()->init($item["data"]["content"])->basic(true)->format()->get(); return array(sprintf(T("email.post.subject"), $item["data"]["title"]), sprintf(T("email.post.body"), name($item["fromMemberName"]), sanitizeHTML($item["data"]["title"]), $content, URL(conversationURL($item["data"]["conversationId"], $item["data"]["title"]) . "/unread", true))); } /** * Returns a formatted notification item for the "updateAvailable" activity type. * * @see postNotification() for parameter and return information. */ public static function updateAvailableNotification($item) { return array(sprintf(T("A new version of esoTalk (%s) is available."), "<strong>" . $item["data"]["version"] . "</strong>"), !empty($item["data"]["releaseNotes"]) ? $item["data"]["releaseNotes"] : "http://esotalk.org/"); } } // Add default activity types. ETActivityModel::addType("post", array("notification" => array("ETActivityModel", "postNotification"), "email" => array("ETActivityModel", "postEmail"))); ETActivityModel::addType("postActivity", array("activity" => array("ETActivityModel", "postActivity"))); ETActivityModel::addType("groupChange", array("activity" => array("ETActivityModel", "groupChangeActivity"), "notification" => array("ETActivityModel", "groupChangeNotification"))); ETActivityModel::addType("mention", array("notification" => array("ETActivityModel", "mentionNotification"), "email" => array("ETActivityModel", "mentionEmail"))); ETActivityModel::addType("join", array("activity" => array("ETActivityModel", "joinActivity"))); // Define an email to send out when a member is added to a private conversation. ETActivityModel::addType("privateAdd", array("notification" => array("ETActivityModel", "privateAddNotification"), "email" => array("ETActivityModel", "privateAddEmail"))); // Notification for when an update to the esoTalk software is available. ETActivityModel::addType("updateAvailable", array("notification" => array("ETActivityModel", "updateAvailableNotification")));