Skip to content

Commit

Permalink
Merge pull request #4473 from parveshsaini/feature/clicksend-sms-prov…
Browse files Browse the repository at this point in the history
…ider-addition

feat(provider): clicksend sms provider addition
  • Loading branch information
BiswaViraj authored Oct 11, 2023
2 parents a8b43c3 + f5ade80 commit 90235ee
Show file tree
Hide file tree
Showing 24 changed files with 343 additions and 62 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,9 @@
"autodocs",
"stackalt",
"mediumdark",
"Docgen"
"Docgen",
"clicksend",
"Clicksend"
],
"flagWords": [],
"patterns": [
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions libs/shared/src/consts/providers/channels/sms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
termiiConfig,
africasTalkingConfig,
sendchampConfig,
clickSendConfig,
} from '../credentials';
import { SmsProviderIdEnum } from '../provider.enum';

Expand Down Expand Up @@ -179,4 +180,12 @@ export const smsProviders: IProviderConfig[] = [
docReference: 'https://docs.novu.co/channels-and-providers/sms/sendchamp',
logoFileName: { light: 'sendchamp.svg', dark: 'sendchamp.svg' },
},
{
id: SmsProviderIdEnum.Clicksend,
displayName: `Clicksend`,
channel: ChannelTypeEnum.SMS,
credentials: clickSendConfig,
docReference: 'https://developers.clicksend.com/docs/rest/v3/?javascript--nodejs#send-sms',
logoFileName: { light: 'clicksend.png', dark: 'clicksend.png' },
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -750,3 +750,20 @@ export const sendchampConfig: IConfigCredentials[] = [
},
...smsConfigBase,
];

export const clickSendConfig: IConfigCredentials[] = [
{
key: CredentialsKeyEnum.User,
displayName: 'Username',
description: 'Your Clicksend API username',
type: 'text',
required: true,
},
{
key: CredentialsKeyEnum.ApiKey,
displayName: 'API Key',
type: 'text',
required: true,
},
...smsConfigBase,
];
1 change: 1 addition & 0 deletions libs/shared/src/consts/providers/provider.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export enum SmsProviderIdEnum {
AfricasTalking = 'africas-talking',
Novu = 'novu-sms',
Sendchamp = 'sendchamp',
Clicksend = 'clicksend',
}

export enum ChatProviderIdEnum {
Expand Down
1 change: 1 addition & 0 deletions packages/application-generic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"@novu/termii": "^0.20.0-alpha.1",
"@novu/testing": "^0.20.0-alpha.1",
"@novu/twilio": "^0.20.0-alpha.1",
"@novu/clicksend": "^0.20.0-alpha.1",
"@sentry/node": "^7.12.1",
"analytics-node": "^6.2.0",
"bullmq": "^3.10.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ChannelTypeEnum, ICredentials } from '@novu/shared';
import { ClicksendSmsProvider } from '@novu/clicksend';
import { BaseSmsHandler } from './base.handler';

export class ClicksendSmsHandler extends BaseSmsHandler {
constructor() {
super('clicksend', ChannelTypeEnum.SMS);
}

buildProvider(credentials: ICredentials) {
const config = {
username: credentials.user,
apiKey: credentials.apiKey,
};

this.provider = new ClicksendSmsProvider(config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export * from './kannel.handler';
export * from './sms-central.handler';
export * from './africas-talking.handler';
export * from './sendchamp.handler';
export * from './clicksend.handler';
export * from './novu.handler';
2 changes: 2 additions & 0 deletions packages/application-generic/src/factories/sms/sms.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
SmsCentralHandler,
AfricasTalkingSmsHandler,
SendchampSmsHandler,
ClicksendSmsHandler,
NovuSmsHandler,
} from './handlers';

Expand All @@ -40,6 +41,7 @@ export class SmsFactory implements ISmsFactory {
new SmsCentralHandler(),
new AfricasTalkingSmsHandler(),
new SendchampSmsHandler(),
new ClicksendSmsHandler(),
new NovuSmsHandler(),
];

Expand Down
Loading

1 comment on commit 90235ee

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.