public static function notify($thread)
    {
        if (is_numeric($thread) && $thread > 0) {
            $forum = Podium::getInstance()->podiumConfig->get('name');
            $email = Content::fill(Content::EMAIL_SUBSCRIPTION);
            $subs = static::find()->where(['thread_id' => $thread, 'post_seen' => self::POST_SEEN]);
            foreach ($subs->each() as $sub) {
                $sub->post_seen = self::POST_NEW;
                if ($sub->save()) {
                    if ($email !== false && !empty($sub->user->email)) {
                        if (Email::queue(
                                $sub->user->email,
                                str_replace('{forum}', $forum, $email->topic),
                                str_replace('{forum}', $forum, str_replace('{link}', Html::a(
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true),
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true)
                                    ), $email->content)),
                                $sub->user_id
                            )) {
                            Log::info('Subscription notice link queued', $sub->user_id, __METHOD__);
                        } else {
                            Log::error('Error while queuing subscription notice link', $sub->user_id, __METHOD__);
                        }
                    } else {
                        Log::warning('Error while queuing subscription notice link - no email set', $sub->user_id, __METHOD__);
                    }
                }
            }
        }
    }
public static function notify($thread)
    {
        if (is_numeric($thread) && $thread > 0) {
            $forum = Podium::getInstance()->podiumConfig->get('name');
            $email = Content::fill(Content::EMAIL_SUBSCRIPTION);
            $subs = static::find()->where(['thread_id' => $thread, 'post_seen' => self::POST_SEEN]);
            foreach ($subs->each() as $sub) {
                $sub->post_seen = self::POST_NEW;
                if ($sub->save()) {
                    if ($email !== false && !empty($sub->user->email)) {
                        if (Email::queue(
                                $sub->user->email,
                                str_replace('{forum}', $forum, $email->topic),
                                str_replace('{forum}', $forum, str_replace('{link}', Html::a(
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true),
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true)
                                    ), $email->content)),
                                $sub->user_id
                            )) {
                            Log::info('Subscription notice link queued', $sub->user_id, __METHOD__);
                        } else {
                            Log::error('Error while queuing subscription notice link', $sub->user_id, __METHOD__);
                        }
                    } else {
                        Log::warning('Error while queuing subscription notice link - no email set', $sub->user_id, __METHOD__);
                    }
                }
            }
        }
    }
public static function notify ( $ thread ) { if ( is_numeric ( $ thread ) && $ thread > 0 ) { $ forum = Podium :: getInstance ( ) -> podiumConfig -> get ( 'name' ) ; $ email = Content :: fill ( Content :: EMAIL_SUBSCRIPTION ) ; $ subs = static :: find ( ) -> where ( [ 'thread_id' => $ thread , 'post_seen' => self :: POST_SEEN ] ) ; foreach ( $ subs -> each ( ) as $ sub ) { $ sub -> post_seen = self :: POST_NEW ; if ( $ sub -> save ( ) ) { if ( $ email !== false && ! empty ( $ sub -> user -> email ) ) { if ( Email :: queue ( $ sub -> user -> email , str_replace ( '{forum}' , $ forum , $ email -> topic ) , str_replace ( '{forum}' , $ forum , str_replace ( '{link}' , Html :: a ( Url :: to ( [ 'forum/last' , 'id' => $ sub -> thread_id ] , true ) , Url :: to ( [ 'forum/last' , 'id' => $ sub -> thread_id ] , true ) ) , $ email -> content ) ) , $ sub -> user_id ) ) { Log :: info ( 'Subscription notice link queued' , $ sub -> user_id , __METHOD__ ) ; } else { Log :: error ( 'Error while queuing subscription notice link' , $ sub -> user_id , __METHOD__ ) ; } } else { Log :: warning ( 'Error while queuing subscription notice link - no email set' , $ sub -> user_id , __METHOD__ ) ; } } } } }
Prepares notification email.
@param int $thread
Prepares notification email .