Skip to content

Commit

Permalink
fix(api-service): empty email preview (#7382)
Browse files Browse the repository at this point in the history
  • Loading branch information
djabarovgeorge authored Dec 26, 2024
1 parent d327605 commit a579eea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
dashboardSanitizeControlValues,
} from '@novu/application-generic';
import { captureException } from '@sentry/node';
import { getErrorPath as getErrorPathAjv } from 'ajv/dist/compile/util';
import { channelStepSchemas, actionStepSchemas } from '@novu/framework/internal';
import { PreviewStep, PreviewStepCommand } from '../../../bridge/usecases/preview-step';
import { FrameworkPreviousStepsOutputState } from '../../../bridge/usecases/preview-step/preview-step.command';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,14 @@ function sanitizeInApp(controlValues: InAppControlType) {
}

function sanitizeEmail(controlValues: EmailControlType) {
const EMPTY_TIP_TAP = JSON.stringify({
type: 'doc',
content: [{ type: 'paragraph' }],
});

const emailControls: EmailControlType = {
subject: controlValues.subject,
body: controlValues.body,
body: isEmpty(controlValues.body) ? EMPTY_TIP_TAP : controlValues.body,
skip: controlValues.skip || undefined,
};

Expand Down

0 comments on commit a579eea

Please sign in to comment.