Send the notification after registeration
436589
static public function sendUserNotification( $userID )
    {
        $ini = eZINI::instance();

        if ( $ini->variable( 'UserSettings', 'EmailRegistrationInfo' ) === "disabled" )
        {
            return array( 'status' => eZModuleOperationInfo::STATUS_CONTINUE );
        }

        eZDebugSetting::writeNotice( 'Sending approval notification to the user.' , 'kernel-user', 'user register' );
        $user = eZUser::fetch( $userID );
        // Send mail
        $tpl = eZTemplate::factory();
        $tpl->setVariable( 'user',  $user );
        $templateResult = $tpl->fetch( 'design:user/registrationapproved.tpl' );

        $mail = new eZMail();
        if ( $tpl->hasVariable( 'content_type' ) )
            $mail->setContentType( $tpl->variable( 'content_type' ) );

        $emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
        if ( $tpl->hasVariable( 'email_sender' ) )
            $emailSender = $tpl->variable( 'email_sender' );
        else if ( !$emailSender )
            $emailSender = $ini->variable( 'MailSettings', 'AdminEmail' );

        if ( $tpl->hasVariable( 'subject' ) )
            $subject = $tpl->variable( 'subject' );
        else
            $subject = ezpI18n::tr( 'kernel/user/register', 'User registration approved' );

        $mail->setSender( $emailSender );
        $receiver = $user->attribute( 'email' );
        $mail->setReceiver( $receiver );
        $mail->setSubject( $subject );
        $mail->setBody( $templateResult );
        $mailResult = eZMailTransport::send( $mail );

        return array( 'status' => eZModuleOperationInfo::STATUS_CONTINUE );
    }
729624
private void sendPublishStartNotify() {
        Status publishStatus = new Status(StatusCodes.NS_PUBLISH_START);
        publishStatus.setClientid(getStreamId());
        publishStatus.setDetails(getPublishedName());

        StatusMessage startMsg = new StatusMessage();
        startMsg.setBody(publishStatus);
        pushMessage(startMsg);
        setState(StreamState.PUBLISHING);
    }
1277617
public function notify()
    {
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug(
                'Subject notify event',
                ['action' => $this->action]
            );
        
        foreach ($this->observers as $observer) {
            $observer->update($this);
        }
    }
149386
private void requestNotification() {
        AndPermission.with(this)
            .notification()
            .permission()
            .rationale(new NotifyRationale())
            .onGranted(new Action<Void>() {
                @Override
                public void onAction(Void data) {
                    toast(R.string.successfully);
                }
            })
            .onDenied(new Action<Void>() {
                @Override
                public void onAction(Void data) {
                    toast(R.string.failure);
                }
            })
            .start();
    }
253053
def handle_notification(self, msgtype, method, args, kwargs):
        """"""
        self.dispatch.call(method, args, kwargs)
107740
public function afterRegistry()
    {
        $this->_filters = $this->util->getTranslated()->getEmptyDropdownArray() + $this->agenda->getFilterList();
        
        parent::afterRegistry();
    }
259439
void onSuccessfulRegistration(Context context, String regId) {

        // You should send the registration ID to your server over HTTP, so it
        // can use GCM/HTTP or CCS to send messages to your app.
        getGcmListener(context).sendRegistrationIdToBackend(regId);

        // Persist the regID - no need to register again.
        // Also serves for detection of previous registrations
        storeRegistrationId(context, regId);
    }
268081
def _notifyDone(self):
        '''
        
        '''
        if self.notified:
            return

        self.doneevent.set()

        for buid in self.mybldgbuids:
            del self.allbldgbuids[buid]

        self.notified = True
144725
public function sendNotify($applicationName, $notificationName, $notificationTitle, $notificationText, $options = array())
    {
        $notification_options = $options;
        $notification_options['text'] = $notificationText;
        $register = new RegisterRequest($applicationName);
        $register->addNotification($notificationName);
        $notify = new NotificationRequest($applicationName, $notificationName, $notificationTitle, $notification_options);
        return $this->notifyOrRegister($notify, $register)->getStatus();
    }
1301169
public function afterRegistry()
    {
        parent::afterRegistry();

        $this->setOnSave('gr2o_opened', new \MUtil_Db_Expr_CurrentTimestamp());
        $this->setSaveOnChange('gr2o_opened');
        $this->setOnSave('gr2o_opened_by', $this->currentUser->getUserId());
        $this->setSaveOnChange('gr2o_opened_by');
    }
699310
public function afterRegistry()
    {
        parent::afterRegistry();

        if (! $this->model instanceof \Gems_Model_RespondentModel) {
            $this->model = $this->loader->getModels()->getRespondentModel(true);
        }
    }
398381
def register_signals(self, app):
        """"""
        before_record_index.connect(inject_provisional_community)
        if app.config['COMMUNITIES_OAI_ENABLED']:
            listen(Community, 'after_insert', create_oaipmh_set)
            listen(Community, 'after_delete', destroy_oaipmh_set)
        inclusion_request_created.connect(new_request)
595773
def save(self, *args, **kwargs):
        
        created = self.pk is None

        # save notification to database only if user settings allow it
        if self.check_user_settings(medium='web'):
            super(Notification, self).save(*args, **kwargs)

        if created:
            # send notifications through other mediums according to user settings
            self.send_notifications()
521321
def register(self, notification_cls=None):
        
        self.loaded = True
        display_names = [n.display_name for n in self.registry.values()]
        if (
            notification_cls.name not in self.registry
            and notification_cls.display_name not in display_names
        ):
            self.registry.update({notification_cls.name: notification_cls})

            models = getattr(notification_cls, "models", [])
            if not models and getattr(notification_cls, "model", None):
                models = [getattr(notification_cls, "model")]
            for model in models:
                try:
                    if notification_cls.name not in [
                        n.name for n in self.models[model]
                    ]:
                        self.models[model].append(notification_cls)
                except KeyError:
                    self.models.update({model: [notification_cls]})
        else:
            raise AlreadyRegistered(
                f"Notification {notification_cls.name}: "
                f"{notification_cls.display_name} is already registered."
            )
47745
private void postRoutedNotificationListenerRegistrationEvent(String operation, NotificationTargetInformation nti) {
        Map<String, Object> props = createListenerRegistrationEvent(operation, nti);
        safePostEvent(new Event(REGISTER_JMX_NOTIFICATION_LISTENER_TOPIC, props));
    }
958337
public function afterRegistry()
    {
        parent::afterRegistry();

        if ($this->project instanceof \Gems_Project_ProjectSettings) {
            $this->useCsrf = $this->project->useCsrfCheck();
        }
    }
1256853
def notify_handler(verb, **kwargs):
    

    # Pull the options out of kwargs
    kwargs.pop('signal', None)
    recipient = kwargs.pop('recipient')
    actor = kwargs.pop('sender')
    optional_objs = [
        (kwargs.pop(opt, None), opt)
        for opt in ('target', 'action_object')
    ]
    public = bool(kwargs.pop('public', True))
    description = kwargs.pop('description', None)
    timestamp = kwargs.pop('timestamp', timezone.now())
    level = kwargs.pop('level', Notification.LEVELS.info)

    # Check if User or Group
    if isinstance(recipient, Group):
        recipients = recipient.user_set.all()
    elif isinstance(recipient, (QuerySet, list)):
        recipients = recipient
    else:
        recipients = [recipient]

    new_notifications = []

    for recipient in recipients:
        newnotify = Notification(
            recipient=recipient,
            actor_content_type=ContentType.objects.get_for_model(actor),
            actor_object_id=actor.pk,
            verb=text_type(verb),
            public=public,
            description=description,
            timestamp=timestamp,
            level=level,
        )

        # Set optional objects
        for obj, opt in optional_objs:
            if obj is not None:
                setattr(newnotify, '%s_object_id' % opt, obj.pk)
                setattr(newnotify, '%s_content_type' % opt,
                        ContentType.objects.get_for_model(obj))

        if kwargs and EXTRA_DATA:
            newnotify.data = kwargs

        newnotify.save()
        new_notifications.append(newnotify)

    return new_notifications