Skip to content

Commit

Permalink
feat(integration): ♿️ Add reply-to name on from field
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jun 27, 2022
1 parent 7b71ac9 commit 75604bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
resultValues: ResultValues
fileUrls?: string
}
const replyToName = replyTo?.split(' <')[0].replace(/"/g, '')

const { host, port, isTlsEnabled, username, password, from } =
(await getEmailInfo(credentialsId)) ?? {}
Expand Down Expand Up @@ -104,7 +105,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
const transporter = createTransport(transportConfig)
const email: Mail.Options = {
from: `"${from.name}" <${from.email}>`,
from: `"${replyToName ?? from.name}" <${from.email}>`,
cc,
bcc,
to: recipients,
Expand Down
5 changes: 3 additions & 2 deletions packages/bot-engine/src/services/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ const sendEmail = async (
return block.outgoingEdgeId
}
const { options } = block
const replyTo = parseVariables(variables)(options.replyTo)
const { error } = await sendRequest({
url: `${apiHost}/api/typebots/${typebotId}/integrations/email?resultId=${resultId}`,
method: 'POST',
Expand All @@ -305,7 +304,9 @@ const sendEmail = async (
body: parseVariables(variables)(options.body ?? ''),
cc: (options.cc ?? []).map(parseVariables(variables)),
bcc: (options.bcc ?? []).map(parseVariables(variables)),
replyTo: replyTo !== '' ? parseVariables(variables)(replyTo) : undefined,
replyTo: options.replyTo
? parseVariables(variables)(options.replyTo)
: undefined,
fileUrls: variables.find(byId(options.attachmentsVariableId))?.value,
isCustomBody: options.isCustomBody,
isBodyCode: options.isBodyCode,
Expand Down

4 comments on commit 75604bd

@vercel
Copy link

@vercel vercel bot commented on 75604bd Jun 27, 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 75604bd Jun 27, 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:

docs – ./apps/docs

docs-git-main-typebot-io.vercel.app
docs.typebot.io
docs-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 75604bd Jun 27, 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:

viewer-v2-alpha – ./apps/viewer

bot.aws.bj
bt.id8rs.com
sat.cr8.ai
am.nigerias.io
apo.nigerias.io
ar.nigerias.io
apr.nigerias.io
vhpage.cr8.ai
aso.nigerias.io
an.nigerias.io
chat.sureb4.com
eventhub.com.au
bot.piccinato.co
bot.upfunnel.art
faqs.nigerias.io
games.klujo.com
clo.closeer.work
sakuranembro.it
feedback.ofx.one
stan.vselise.com
voicehelp.cr8.ai
app.chatforms.net
gentleman-shop.fr
goalsettingbot.com
sell.applepie.pro
zap.techadviser.in
ov2.wpwakanda.com
ov1.wpwakanda.com
ov3.wpwakanda.com
this-is-a-test.com
bot.eventhub.com.au
forms.webisharp.com
chat.hayurihijab.com
typebot.stillio.com
get.freebotoffer.xyz
bot.ansuraniphone.my
bot.incusservices.com
abutton.wpwakanda.com
bot.cotemeuplano.com
bbutton.wpwakanda.com
bot.meuesocial.com.br
cdd.searchcube.com.sg
chat.missarkansas.org
sbutton.wpwakanda.com
apply.ansuraniphone.my
bbutton.wpwwakanda.com
c23111azqw.nigerias.io
felipewelington.com.br
gcase.barrettamario.it
form.searchcube.com.sg
info.clickasuransi.com
kodawariab736.skeep.it
view.onlinebotdemo.xyz
83242573.actualizar.xyz
mainmenu.diddancing.com
form.sergiolimajr.com.br
hunterbot.saleshunter.ai
aibot.angrybranding.co.uk
subfooter.wpwakanda.com
91181264.your-access.one
type.opaulovieira.com.br
bot.cabinrentalagency.com
designguide.techyscouts.com
boyfriend-breakup.riku.ai
type.dericsoncalari.com.br
agendamento.sergiolimajr.com.br
bookings.littlepartymonkeys.com
piazzatorre.barrettamario.it
type.talitasouzamarques.com.br
onboarding.libertydreamcare.ie
bot.comercializadoraomicron.com
personal-trainer.barrettamario.it
studiotecnicoimmobiliaremerelli.it
viewer-v2-alpha-typebot-io.vercel.app
preagendamento.sergiolimajr.com.br
viewer-v2-alpha-git-main-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 75604bd Jun 27, 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
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app

Please sign in to comment.