-
-
Save DanyF-github/0d7fb5aa2dba22bcdc23780f71506bcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/signup', function(req, res) { | |
let phone = req.body.number; | |
vonage.channel.send( | |
{ type: 'whatsapp', number: phone }, | |
{ type: 'whatsapp', number: process.env.WHATSAPP_NUM }, | |
{ content: { | |
type: 'text', | |
text: 'Welcome to Nice Cool Shoes! What should we call you?' | |
}}, (e, data) => { | |
if (e) { | |
console.error(e); | |
} else { | |
db.run('INSERT INTO State (phone, state) VALUES ($phone, $state)', { | |
$phone: parseInt(phone), | |
$state: states.getUsername | |
}, (err) => { | |
if (err) { | |
console.error(err); | |
} | |
}); | |
} | |
} | |
); | |
res.send({}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment