GithubHelp home page GithubHelp logo

meteor-invites's Introduction

meteor-invites

An invitation management system for Meteor.

Features

  • Built-in invitesAdmin template for quick and easy management of: -- Invite Requests: So users can 'apply' for invitations via your own forms -- Invitations: Which you can create from scratch or from the above requests.
  • Built-in simple emails for request confirmation and/or invitation creation -OR-
  • Custom email handlers, i.e. use your own email templator, etc.

Usage

Config

meteor add t3db0t:invites

Invites.config({
	from: "MyApp <[email protected]>",
	inviteRequest: {
    	subject: "Thanks for requesting an invitation to MyApp Beta",
    	body: "Thanks for your interest in MyApp! We'll let you know when you've been invited."
  	},
  	invite: {
    	subject: "Welcome to MyApp Beta",
    	body: "You've been invited to MyApp!"
  	}
});

Routes

meteor-invites is router-agnostic, so you'll need to implement your own routes. However, it does include some templates:

  • The included inviteAdmin template, for example (Iron Router): Router.route('/invites', 'inviteAdmin'); -- You can use your router to secure this route, for example (Iron Router):
Router.route('/invites', {
    onBeforeAction: function(){
	    if(!Meteor.userId() || !Meteor.user().registered_emails) {
	      this.render('notfound');
	    } else if(Meteor.user().registered_emails[0].address == "[email protected]"){
	      this.next();
	    }
  	},
    template: 'inviteAdmin'
});
  • There's also an included "Invite Request Confirmation" template at confirmInviteRequest

Publications

Optional: There's a requests-email publication you can subscribe to with an email address and it will give you the request status for that email, i.e. if you want to check if someone's already requested an invite. Example:

Meteor.subscribe('requests-email', '[email protected]');

Custom Email Handlers

For example, using PrettyEmail:

Invites.configEmailHandlers({
  inviteRequestHandler: function(requestEmail){

    PrettyEmail.send('call-to-action', {
      to: requestEmail,
      subject: 'Thanks for requesting an invitation to MyApp',
      heading: '',
      message: "Thanks for your interest in MyApp! Just click below to verify your email address and we'll let you know when you've been invited.",
      buttonText: 'Confirm',
      // buttonUrl: '', // Coming soon
    });
  },
  inviteHandler: function(token, inviteEmail){
    var host = Meteor.absoluteUrl();

    PrettyEmail.send('call-to-action', {
      to: inviteEmail,
      subject: 'Welcome to MyApp',
      heading: "You've been invited to MyApp",
      message: "Click below to accept and get started.",
      buttonText: "Let's Go",
      buttonUrl: host+'acceptInvite/'+token,
    });
  }
});

Pull requests welcome!

meteor-invites's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mohala562

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.