npm install ncp-sdk
yarn add ncp-sdk
Class |
Method |
Description |
NcloudSDK |
sendMail |
NCP의 Cloud Outbound Mailer를 이용하여 메일을 전송합니다 |
NcloudSDK |
sendSMS |
NCP의 Simple & Easy Notification Service를 이용하여 문자 메세지를 전송합니다 |
import { NcloudSDK } from "ncp-sdk"
const sdk = new NcloudSDK({
accessKey: process.env.ACCESS_KEY,
secretKey: process.env.SECRET_KEY,
})
sdk.sendMail({
sender: "pukuba@kakao.com",
receiver: "20sunrin041@sunrint.hs.kr",
title: "test email title",
content: "test email content",
}).then((res) => console.log(res))
import { NcloudSDK } from "ncp-sdk"
const sdk = new NcloudSDK({
accessKey: process.env.ACCESS_KEY,
secretKey: process.env.SECRET_KEY,
smsKey: process.env.SMS_KEY,
})
sdk.sendSMS({
sender: "010xxxxxxxx",
receiver: "010xxxxxxxx"
content: "test sms content"
}).then((res) => console.log(res))