text: /**
   * @overview Trigger a Zap on Every User Login to Zapier
   * @gallery true
   * @category webhook
   *
   * Trigger a Zap on Every User Login
   *
   * What is Zapier?** [Zapier](http://zapier.com) is a tool for primarily non-technical users to connect together web apps. An integration between two apps is called a Zap. A Zap is made up of a Trigger and an Action. Whenever the trigger happens in one app, Zapier will automatically perform the action in another app.
   *
   * https://cloudup.com/iGyywQuJqIb+
   *
   * This rule will call Zapier static hook every time a user logs in.
   */
  
  function (user, context, callback) {
    const request = require('request');
    const _ = require('lodash');
  
    const ZAP_HOOK_URL = 'https://zap.example.com/hook-path'; // replace with your hook url
  
    const small_context = {
      appName: context.clientName,
      userAgent: context.request.userAgent,
      ip: context.request.ip,
      connection: context.connection,
      strategy: context.connectionStrategy
    };
  
    const payload_to_zap = _.extend({}, user, small_context);
  
    request.post({
      url: ZAP_HOOK_URL,
      json: payload_to_zap
    },
    function (err, response, body) {
      // swallow error
      callback(null, user, context);
    });
  }
  