Rainmaker
Rainmaker
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
When it's released, I'll be back to you if it worked.
14 replies
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
Thank you so much @Pawan Jain
14 replies
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
Hello @Pawan Jain Do you have any news? Thanks.
14 replies
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
Thank you @Pawan Jain . Just curious, is there a ETA to fix bugs like that?
14 replies
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
Sure @Pawan Jain It's something like that:
import { workflow } from "@novu/framework";
import { payloadSchema } from "./schemas";

export const verificationCode = workflow(
"verification-code",
async ({ step, payload }) => {
await step.email(
"send-email",
() => ({
subject: 'Your verification code',
body: `Hello! This is your verification code: ${payload.code}`,
}),
{
skip: () => payload.type !== "email",
},
);

await step.sms(
"send-sms",
() => ({
body: `Your verification code is: ${payload.code}`
}),
{
skip: () => payload.type !== "sms",
},
);
},
{ payloadSchema },
);
import { workflow } from "@novu/framework";
import { payloadSchema } from "./schemas";

export const verificationCode = workflow(
"verification-code",
async ({ step, payload }) => {
await step.email(
"send-email",
() => ({
subject: 'Your verification code',
body: `Hello! This is your verification code: ${payload.code}`,
}),
{
skip: () => payload.type !== "email",
},
);

await step.sms(
"send-sms",
() => ({
body: `Your verification code is: ${payload.code}`
}),
{
skip: () => payload.type !== "sms",
},
);
},
{ payloadSchema },
);
Thank you for your response.
14 replies
NNovu
Created by Rainmaker on 8/1/2024 in #💬│support
Next step is skipped as well when the first one is skipped
Environment ID: 66a79f82dfafba8038bc33a4
14 replies