Code Monkey home page Code Monkey logo

meteor-contact-form's Introduction

Simple contact form for Meteor applications

This is a contact form based on https://github.com/bredikhin/meteor-contact-form

The current implementation integrates with https://github.com/appshore/Meteor-reCAPTCHA/ that utilizes Google reCaptcha service.

Changes:

  • Added appshore recaptcha
  • Changed the status message to the top of the form.
  • Changed the way emailTo needs to be specified.

Installation

meteor add branco:contact-form

Usage

All it takes is two simple steps:

###1. Sign up and get the public and secret key from Google reCaptcha service: https://www.google.com/recaptcha/intro/index.html

###2. Configure on the server: Setup your settings.json (at the root of your project)

{

  "public":
  {
    "contactForm":
    {
      "emailTo":"[email protected]"
    },
    "recaptcha":
    {
      "publickey":"<public_key_from_google>"
    },
  },
  "private":
  {
    "recaptcha":
    {
      "secretKey":"<secret_key_from_google>"
    },
  }
}
...

Display on the client:

{{>contactForm }}
...

##Custom Schema with i18n

You can override the default Schema by using

  • In your template:
<template name="myform">
{{contactForm schema=contactSchema}}
</template>

-Define a helper to provide the custom schema

Schema.contactForm = new SimpleSchema({
    name: {
        type: String,
        autoform: {
            type: "text"
        },
        i18nLabel: '<Tapi18n.key>',
        max: 64
    },
    ...
});

Template.myform.helpers({
  "contactSchema": function()
  {
    return Schema.contactForm;
  }
}

By specifying the i18nLabel ( which corresponds to a TAPi18n key that you should have previously defined) it will reactively change according to the language set.

What is next?

  • Custom Schema injection - Allows specification of a given schema to be used for the contact form
  • i18n integration - Enabling multi-lingual contact form.

License

The MIT License

Copyright (c) 2015 Junio Branco

meteor-contact-form's People

Contributors

bredikhin avatar tenshiemi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.