Newsletter Content service
555017
protected function registerNewsletterService(){

        $this->app->bind('designpond\newsletter\Newsletter\Repo\NewsletterInterface', function()
        {
            return new \designpond\newsletter\Newsletter\Repo\NewsletterEloquent( new \designpond\newsletter\Newsletter\Entities\Newsletter );
        });
    }
196989
def update
      @newsletter_subscription = Cmtool::NewsletterSubscription.find(params[:id])

      respond_to do |format|
        if @newsletter_subscription.update_attributes(newsletter_subscription_params)
          format.html { redirect_to([cmtool, @newsletter_subscription], :notice => I18n.t('cmtool.action.update.successful', :model => Cmtool::NewsletterSubscription.model_name.human)) }
          format.xml  { head :ok }
        else
          format.html { render :action => "edit" }
          format.xml  { render :xml => @newsletter_subscription.errors, :status => :unprocessable_entity }
        end
      end
    end
185462
def preview_to(recipient)
      @newsletter = build_newsletter
      mail = build_mail
      mail.to = recipient.email
      replace_and_send_mail_safely(mail, recipient)
    end
725145
def receive(self, content, **kwargs):
        
        self.connection_context = DjangoChannelConnectionContext(self.message)
        self.subscription_server = DjangoChannelSubscriptionServer(graphene_settings.SCHEMA)
        self.subscription_server.on_open(self.connection_context)
        self.subscription_server.handle(content, self.connection_context)
886821
function subscribe() {
  openSTNotification.subscribeEvent.rabbit(
    ['#'],
    {queue: 'openst_platform'},
    function (msgContent) {
      logger.debug('[RECEIVED]', msgContent, '\n');
    }
  ).catch(function (err) {
    logger.error(err);
  });
}
840002
def listen_for_updates(self):
        """"""
        self.toredis.subscribe(self.group_pubsub, callback=self.callback)
458107
function Subscription () {
  this._id = null

  this._storeRelations = null
  this._memberRelations = null
  this._dependencyRelations = null

  this._events = {
    'beforePublish': [],
    'afterPublish': []
  }

  this._subscriptionStream = null
  this._stream = null
  this._lastData = null

  this._muted = false

  storeRelation.constructParent(this)
  memberRelation.constructParent(this)
  dependencyRelation.constructParent(this)

  subscription.apply(this, arguments)
}
425780
async def _subscribe(self, channels, is_mask):
        """"""
        news = []
        for channel in channels:
            key = channel, is_mask
            self._channels.append(key)
            if key in self._plugin._subscriptions:
                self._plugin._subscriptions[key].append(self._queue)
            else:
                self._plugin._subscriptions[key] = [self._queue]
                news.append(channel)
        if news:
            await getattr(self._sub, 'psubscribe' if is_mask else 'subscribe')(news)
1150985
def new
      @newsletter_subscription = Cmtool::NewsletterSubscription.new

      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml => @newsletter_subscription }
      end
    end
170590
private function copyNewsletter()
    {
        // models
        $source =  "{$this->appPath}Models{$this->ds}NewsletterSubscriber.php";
        $this->copyFilesFromSource($source, app_path("Models"), 'namespace_views');

        // controllers
        $destination = app_path("Http{$this->ds}Controllers{$this->ds}Admin{$this->ds}Newsletter");
        $source = "{$this->appPath}Controllers{$this->ds}Admin{$this->ds}Newsletter{$this->ds}SubscribersController.php";
        $this->copyFilesFromSource($source, $destination, 'namespace_views');

        // views
        $destination = base_path("resources{$this->ds}views{$this->ds}admin{$this->ds}newsletters");
        $source = "{$this->basePath}resources{$this->ds}views{$this->ds}admin{$this->ds}newsletters";
        $this->copyFilesFromSource($source, $destination);

        // migrations
        $source = "{$this->basePath}database{$this->ds}migrations{$this->ds}2017_10_01_181435_create_newsletter_subscribers_table.php";
        $this->copyFilesFromSource($source, database_path("migrations"));

    }
420358
def refresh_content(self, order=None, name=None):
        
        # reddit.get_my_subreddits() does not support sorting by order
        if order:
            self.term.flash()
            return

        with self.term.loader():
            self.content = SubscriptionContent.from_user(
                self.reddit, self.term.loader, self.content_type)
        if not self.term.loader.exception:
            self.nav = Navigator(self.content.get)
135872
def send_message(self, id_service, content):
        """"""
        if not content:
            return
        with self._lock:
            try:
                message = "Message: %s to %s" % (content, id_service)
                self.write_message(message)
                self.stream.flush()  # flush after each message
                return "message_id"
            except Exception:
                if not self.fail_silently:
                    raise
1368402
function sendDirectToUser(content, username) {
    return getDirectMessageRoomId(username)
        .then((rid) => sendToRoomId(content, rid));
}
400827
function newService()
    {
        $setting = $this->getSetting();
        // Give Current Container As ServiceManager To SAPI Application
        if (! $this->_isCommandLineMode() )
            VOID; // maybe default modules


        $builder = new BuildSapi($setting);
        $app     = new Sapi( $builder, $this->services() );

        return $app;
    }
561052
function(to,tmpName,obj,cb){
    fs.readFile(
      path.join(__dirname, 'emailBoiler.html'),
      'utf8',
      function(err, data) {
        if (err){
          return cb(err);
        }
        var tmp = cfg.templates[tmpName];
        var locals = {
          title: '',
          content: tmp.text,
        };

        var html = ejs.render(data, locals);
        obj.link = '<a href="' + obj.url + '">' + tmp.linkText + '</a>';
        html = ejs.render(html,obj);

        var subject = ejs.render(tmp.subject,obj);

        sendEmail(to,subject,html,cb);
      }
    );
  }
1176066
function subscribeToMessages() {
    return subscribe(_messageCollectionName, _messageStreamName)
        .then((subscription) => {
        exports.messages = exports.asteroid.getCollection(_messageCollectionName);
        return subscription;
    });
}
978635
def get_inbox(self, *args, **kwargs):
        
        return self.get_content(self.config['inbox'], *args, **kwargs)