Package Exports
- kakao-bizmessage-toast
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kakao-bizmessage-toast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-kakao-bizmessage-toast
토스트(Toast)를 이용한 카카오 비즈메세지(알림톡 / 친구톡) 전송 Client
기능
- 카카오톡 비즈메세지(알림톡/
친구톡/상담톡) 전송
설치
npm 사용:
$ npm install kakao-bizmessage-toast
yarn 사용:
$ yarn add kakao-bizmessage-toast
사용 예시
// 셋팅
const ToastKakaoBizmessage = require('kakao-bizmessage-toast');
const client = new ToastKakaoBizmessage({
appKey: `${YOUR_TOAST_APP_KEY}`,
secretKey: `${YOUR_TOAST_SECRET_KEY}`,
});
// 일반 알림톡 전송
const templateCode = 'testTemplateCode';
const recipientList = [{
recipientNo: '01012345678',
content: '현호님 카플랫 이용은 어떠셨나요?',
}];
client.sendRawMessages(templateCode, recipientList);
// 같은 알림톡 일괄 전송
const templateCode = 'testTemplateCode';
const recipientList = ['01012345678', '01087654321'];
const contet = '여러분 카플랫 이용은 어떠셨나요?';
client.sendSameRawMessagesToMultipleUsers(templateCode, recipientList, content);
// 예약 알림톡 전송 / 취소
async someFunction(templateCode, recipientList, requestDate) {
try {
// requestDate 시점에 예약 전송
const requestId = await client.sendRawMessages(templateCode, recipientList, requestDate);
// requestId 에 해당하는 알림톡 취소
await client.cancelToRequest(requestId);
return 'success';
} catch (err) {
return err;
}
}