Giter Site home page Giter Site logo

slackform's Introduction

SlackForm by lucasjgordon

SlackForm is a node module that will allow you to automatically invite new Typeform submissions to your Slack community.

Basic Usage

Add SlackForm.js to your project, run npm install. Include the module using:

var SlackForm = require('./SlackForm.js');

Now you need to get your keys. You'll need you Typeform API Key and the name of your Slack group as it is shown in the group's url. Create a new Slack token here. You'll need your Typeform ID, which can be obtained from the URL of the actual form - it will look something like this "bU6FKI".

Finally, you need to know the name of the email field in the Typeform JSON response. Create a URL like this:

https://api.typeform.com/v0/form/TYPEFORM_ID?key=TYPEFORM_API_KEY&completed=true&limit=1

Load it, and in the questions array find the form entry that asks for the user's email address. You need the id of the email field, it should look something like this "email_4202153".

Initialise SlackForm like this:

var slackForm = new SlackForm({
	typeformApiKey: '<TYPEFORM_API_KEY>',
	typeformId: '<TYPEFORM_ID>',
	typeformEmail: '<TYPEFORM_EMAIL_ID>',
	slackChannel: '<SLACK_GROUP_NAME>',
	slackToken: '<SLACK_TOKEN>'
});

Public Methods

###Invite This method sends invites to all email addresses from Typeform submissions within the last hour. It returns an array of responses from each invite request. Set up a cron job to run the script every hour.

slackForm.invite(function (err, data) {
	if (err) {
		throw err;
	}

	console.log(data);
});

slackform's People

Contributors

lucasjgordon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.