var express = require('express');
var router = express.Router();
var request = require('request');
var config = require('../config');

router.get('/', function(req, res) {
  res.render('index', { community: config.community });
});

router.post('/invite', function(req, res) {
  if (req.body.email) {
    request.post({
        url: 'https://'+ config.slackUrl + '/api/users.admin.invite',
        form: {
          email: req.body.email,
          token: config.slacktoken,
          set_active: true
        }
      }, function(err, httpResponse, body) {
        // body looks like:
        //   {"ok":true}
        //       or
        //   {"ok":false,"error":"already_invited"}
        if (err) { return res.send('Error:' + err); }
        body = JSON.parse(body);
        if (body.ok) {
          res.send('Success! Check "'+ req.body.email +'" for an invite from Slack.');
        } else {
          res.send('Failed! ' + body.error)
        }
      });
  } else {
    res.status(400).send('email is required.');
  }
});

module.exports = router;

@@ -715,17 +715,16 @@
 nd('Erro
-r
 :' + err
@@ -808,22 +808,35 @@
 nd('
-Success! Check
+Parab%C3%A9ns! Verifique o email
  %22'+
@@ -859,26 +859,33 @@
 +'%22 
-for an i
+para aceitar o co
 nvite 
-from
+do
  Sla
@@ -932,14 +932,12 @@
 nd('
-Failed
+Erro
 ! ' 
@@ -1011,25 +1011,27 @@
 nd('
-e
+E
 mail 
-is required
+%C3%A9 Obrigat%C3%B3rio
 .');

Update index.js