lib/Staticman.js
/**
   * Subscribe a user to notification emails sent whenever new comments are added (to a post,
   * parent comment, etc.). It is expected that this is being triggered upon clicking-through
   * a confirmation email.
   * @param data {Object} - Contains the context of the original subscription request, including
   *  subscriber email address, entry being subscribed to, request data, audit fields, etc.
   * return {Promise} - can be resolved to obtain the result of attempting to subscribe the user
   *  via the mailing list agent.
   */
Subscribe a user to notification emails sent whenever new comments are added (to a post,
parent comment, etc.). It is expected that this is being triggered upon clicking-through
a confirmation email.
@param data {Object} - Contains the context of the original subscription request, including
subscriber email address, entry being subscribed to, request data, audit fields, etc.
return {Promise} - can be resolved to obtain the result of attempting to subscribe the user
via the mailing list agent.
Subscribe a user to notification emails sent whenever new comments are added ( to a post parent comment etc . ) . It is expected that this is being triggered upon clicking - through a confirmation email . @param data { Object } - Contains the context of the original subscription request including subscriber email address entry being subscribed to request data audit fields etc . return { Promise } - can be resolved to obtain the result of attempting to subscribe the user via the mailing list agent .
async createSubscription (data) {
    return this.getSiteConfig().then(config => {
      const subscriptions = this._initialiseSubscriptions()
      return subscriptions.set(data, data.subscriberEmailAddress, this.siteConfig)
    }).catch(err => {
      return Promise.reject(errorHandler('ERROR_CREATING_SUBSCRIPTION', {
        err,
        instance: this
      }))
    })
  }
async createSubscription ( data ) { return this . getSiteConfig ( ) . then ( config => { const subscriptions = this . _initialiseSubscriptions ( ) return subscriptions . set ( data , data . subscriberEmailAddress , this . siteConfig ) } ) . catch ( err => { return Promise . reject ( errorHandler ( 'ERROR_CREATING_SUBSCRIPTION' , { err , instance : this } ) ) } ) }
Subscribe a user to notification emails sent whenever new comments are added (to a post,
 parent comment, etc.).
Subscribe a user to notification emails sent whenever new comments are added ( to a post parent comment etc . ) .