Skip to content

Commit

Permalink
fix(integrations): πŸš‘οΈ Empty body emails
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jun 15, 2022
1 parent 2a6e065 commit 0ffdd88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { createTransport, getTestMessageUrl } from 'nodemailer'
import {
decrypt,
initMiddleware,
isEmpty,
isNotDefined,
methodNotAllowed,
omit,
Expand Down Expand Up @@ -157,7 +158,7 @@ const getEmailBody = async ({
SendEmailOptions,
'isCustomBody' | 'isBodyCode' | 'body'
>): Promise<{ html?: string; text?: string } | undefined> => {
if (isCustomBody || isNotDefined(isCustomBody))
if (isCustomBody || (isNotDefined(isCustomBody) && !isEmpty(body)))
return {
html: isBodyCode ? body : undefined,
text: !isBodyCode ? body : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const sendEmailBlockSchema = blockBaseSchema.and(

export const defaultSendEmailOptions: SendEmailOptions = {
credentialsId: 'default',
isCustomBody: false,
recipients: [],
}

Expand Down

4 comments on commit 0ffdd88

@vercel
Copy link

@vercel vercel bot commented on 0ffdd88 Jun 15, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 0ffdd88 Jun 15, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 0ffdd88 Jun 15, 2022

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 0ffdd88 Jun 15, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

landing-page-v2 – ./apps/landing-page

landing-page-v2-typebot-io.vercel.app
get-typebot.com
landing-page-v2-git-main-typebot-io.vercel.app
www.get-typebot.com
typebot.io
www.typebot.io

Please sign in to comment.