Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions apps/api/src/app/integrations/dtos/credentials.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ export class CredentialsDto implements ICredentials {
@IsString()
@IsOptional()
senderId?: string;

@ApiPropertyOptional()
@IsString()
@IsOptional()
tenantId?: string;

@ApiPropertyOptional()
@IsOptional()
Expand Down
32 changes: 32 additions & 0 deletions apps/dashboard/public/images/providers/light/square/msgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions apps/web/public/static/images/providers/dark/msgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions apps/web/public/static/images/providers/dark/square/msgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions apps/web/public/static/images/providers/light/msgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions apps/web/public/static/images/providers/light/square/msgraph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export * from './sendgrid.handler';
export * from './sendinblue.handler';
export * from './ses.handler';
export * from './sparkpost.handler';
export * from './msgraph.handler';
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MsGraphEmailProvider } from '@novu/providers';
import { ChannelTypeEnum, EmailProviderIdEnum, ICredentials } from '@novu/shared';
import { BaseEmailHandler } from './base.handler';

export class MsGraphHandler extends BaseEmailHandler {
constructor() {
super(EmailProviderIdEnum.MsGraph, ChannelTypeEnum.EMAIL);
}

buildProvider(credentials: ICredentials) {
const config = {
clientId: credentials.clientId as string,
clientSecret: credentials.secretKey as string,
tenantId: credentials.tenantId as string,
from: credentials.from as string,
senderName: credentials.senderName as string,
};

this.provider = new MsGraphEmailProvider(config);
}
}
2 changes: 2 additions & 0 deletions libs/application-generic/src/factories/mail/mail.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
SendgridHandler,
SendinblueHandler,
SparkPostHandler,
MsGraphHandler,
} from './handlers';
import { IMailFactory, IMailHandler } from './interfaces';

Expand All @@ -45,6 +46,7 @@ export class MailFactory implements IMailFactory {
new EmailWebhookHandler(),
new NovuEmailHandler(),
new BrazeEmailHandler(),
new MsGraphHandler(),
];

getHandler(
Expand Down
2 changes: 2 additions & 0 deletions libs/dal/src/repositories/integration/integration.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const integrationSchema = new Schema<IntegrationDBModel>(
accessKey: Schema.Types.String,
appSid: Schema.Types.String,
senderId: Schema.Types.String,
servicePlanId: Schema.Types.String,
tenantId: Schema.Types.String,
servicePlanId: Schema.Types.String,
AppIOBaseUrl: Schema.Types.String,
AppIOSubscriptionId: Schema.Types.String,
Expand Down
1 change: 1 addition & 0 deletions packages/framework/src/schemas/providers/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export const emailProviderSchemas = {
sendinblue: genericProviderSchemas,
ses: genericProviderSchemas,
sparkpost: genericProviderSchemas,
msgraph: genericProviderSchemas,
} as const satisfies Record<EmailProviderIdEnum, { output: JsonSchema }>;
1 change: 1 addition & 0 deletions packages/framework/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export enum EmailProviderIdEnum {
SparkPost = 'sparkpost',
EmailWebhook = 'email-webhook',
Braze = 'braze',
MsGraph = 'msgraph',
}

export enum SmsProviderIdEnum {
Expand Down
1 change: 1 addition & 0 deletions packages/providers/src/lib/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export * from './ses/ses.config';
export * from './ses/ses.provider';
export * from './sparkpost/sparkpost.error';
export * from './sparkpost/sparkpost.provider';
export * from './msgraph-mail/msgraph-mail.provider';
Loading
Loading