Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ class SendOtp {
/**
* Creates a new SendOtp instance
* @param {string} authKey Authentication key
* @param {boolean} isInternational send true if it is an international message, otherwise false.
* @param {string, optional} messageTemplate
*/
constructor(authKey, messageTemplate) {
constructor(authKey, isInternational, messageTemplate) {
this.authKey = authKey;
if(messageTemplate){
this.messageTemplate = messageTemplate;
}else{
this.messageTemplate = "Your otp is {{otp}}. Please do not share it with anybody";
}
this.otp_expiry = 1440; //1 Day =1440 minutes
this.isInternational = isInternational
}

/**
Expand Down Expand Up @@ -63,6 +65,10 @@ class SendOtp {
otp: otp,
otp_expiry: this.otp_expiry
};

if (this.isInternational) {
args.country=0
}
return SendOtp.doRequest('get', "sendotp.php", args, callback);
}

Expand Down