Email/Calendar Microservice for HR-CRM System.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
npm run start:prod
Create an .env
file with client id, client secret and redirect_uris for the app. To get those go to https://console.developers.google.com/start/api?id=gmail to create or select a project in the Google Developers Console.
CLIENT_ID=
CLIENT_SECRET=
REDIRECT_URIS=
- Google account as Developer
- Select or Create a Cloud Platform project
- Enable billing for your project
- Create Storage
- Create Bucket
- Enable the Google Cloud Storage API
- Get projectId and service-account
Login or Sign up in the https://www.nexmo.com.
Using your NEXMO API_KEY and API_SECRET, available from the dashboard getting started page, you can now send an SMS message:
curl -X "POST" "https://rest.nexmo.com/sms/json" \
-d "from=Acme Inc" \
-d "text=A text message sent using the Nexmo SMS API" \
-d "to=TO_NUMBER" \
-d "api_key=NEXMO_API_KEY" \
-d "api_secret=NEXMO_API_SECRET"
const Nexmo = require('nexmo');
const nexmo = new Nexmo({
apiKey: 'API_KEY',
apiSecret: 'API_SECRET'
});
const from = 'Nexmo';
const to = 'TO_NUMBER';
const text = 'A text message sent using the Nexmo SMS API';
nexmo.message.sendSms(from, to, text, (error, response) => {
if(error) {
throw error;
} else if(response.messages[0].status != '0') {
console.error(response);
throw 'Nexmo returned back a non-zero status';
} else {
console.log(response);
}
});
You need to put API_KEY and API_SECRET to NestJS/src/Event/phone_notification/sms.js