-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bot): ✨ Custom email body and HTML content
- Loading branch information
1 parent
aeaaa5c
commit 97980f4
Showing
8 changed files
with
358 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
const emailRegex = | ||
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | ||
|
||
const parseResult = (val?: string) => | ||
val && emailRegex.test(val) ? `<a href="mailto:${val}">${val}</a>` : val ?? '' | ||
|
||
export const newLeadEmailContent = ( | ||
resultUrl: string, | ||
answers: { [key: string]: string } | ||
) => ` | ||
<!doctype html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> | ||
<head> | ||
<title> | ||
</title> | ||
<!--[if !mso]><!--> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<!--<![endif]--> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<style type="text/css"> | ||
#outlook a { | ||
padding: 0; | ||
} | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
-webkit-text-size-adjust: 100%; | ||
-ms-text-size-adjust: 100%; | ||
} | ||
table, | ||
td { | ||
border-collapse: collapse; | ||
mso-table-lspace: 0pt; | ||
mso-table-rspace: 0pt; | ||
} | ||
img { | ||
border: 0; | ||
height: auto; | ||
line-height: 100%; | ||
outline: none; | ||
text-decoration: none; | ||
-ms-interpolation-mode: bicubic; | ||
} | ||
p { | ||
display: block; | ||
margin: 13px 0; | ||
} | ||
</style> | ||
<!--[if mso]> | ||
<noscript> | ||
<xml> | ||
<o:OfficeDocumentSettings> | ||
<o:AllowPNG/> | ||
<o:PixelsPerInch>96</o:PixelsPerInch> | ||
</o:OfficeDocumentSettings> | ||
</xml> | ||
</noscript> | ||
<![endif]--> | ||
<!--[if lte mso 11]> | ||
<style type="text/css"> | ||
.mj-outlook-group-fix { width:100% !important; } | ||
</style> | ||
<![endif]--> | ||
<style type="text/css"> | ||
@media only screen and (min-width:480px) { | ||
.mj-column-per-100 { | ||
width: 100% !important; | ||
max-width: 100%; | ||
} | ||
} | ||
</style> | ||
<style media="screen and (min-width:480px)"> | ||
.moz-text-html .mj-column-per-100 { | ||
width: 100% !important; | ||
max-width: 100%; | ||
} | ||
</style> | ||
<style type="text/css"> | ||
</style> | ||
</head> | ||
<body style="word-spacing:normal;background-color:#ffffff;"> | ||
<div style="background-color:#ffffff;"> | ||
<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> | ||
<div style="margin:0px auto;max-width:600px;"> | ||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> | ||
<tbody> | ||
<tr> | ||
<td style="border:1px solid #E2E8F0;direction:ltr;font-size:0px;padding:0;text-align:center;"> | ||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" width="600px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:598px;" width="598" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> | ||
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:598px;"> | ||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"> | ||
<tbody> | ||
<tr> | ||
<td style="direction:ltr;font-size:0px;padding:0;padding-bottom:20px;padding-top:20px;text-align:center;"> | ||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:598px;" ><![endif]--> | ||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"> | ||
<tbody> | ||
<tr> | ||
<td style="vertical-align:top;padding:0;"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style width="100%"> | ||
<tbody> | ||
<tr> | ||
<td align="left" style="font-size:0px;padding:10px 40px;word-break:break-word;"> | ||
<div style="font-family:Helvetica Neue, Helvetica, Helvetica, Arial, sans-serif;font-size:16px;line-height:23px;text-align:left;color:#000000;">Your typebot has collected a <strong>new lead!</strong> 🥳</div> | ||
</td> | ||
</tr> | ||
${Object.keys(answers) | ||
.map( | ||
(key) => `<tr> | ||
<td align="left" style="font-size:0px;padding:10px 40px;word-break:break-word;"> | ||
<div style="font-family:Helvetica Neue, Helvetica, Helvetica, Arial, sans-serif;font-size:16px;line-height:23px;text-align:left;color:#000000;">${key}: ${parseResult( | ||
answers[key] | ||
)}</div> | ||
</td> | ||
</tr>` | ||
) | ||
.join('')} | ||
</tbody> | ||
</table> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!--[if mso | IE]></td></tr></table><![endif]--> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!--[if mso | IE]></td></tr></table></td></tr><tr><td class="" width="600px" ><table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:598px;" width="598" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]--> | ||
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:598px;"> | ||
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;"> | ||
<tbody> | ||
<tr> | ||
<td style="direction:ltr;font-size:0px;padding:0;padding-bottom:20px;text-align:center;"> | ||
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:598px;" ><![endif]--> | ||
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%"> | ||
<tbody> | ||
<tr> | ||
<td style="vertical-align:top;padding:0;"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style width="100%"> | ||
<tbody> | ||
<tr> | ||
<td align="center" vertical-align="middle" style="font-size:0px;padding:0;word-break:break-word;"> | ||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;"> | ||
<tr> | ||
<td align="center" bgcolor="#0042da" role="presentation" style="border:none;border-radius:5px;cursor:auto;mso-padding-alt:10px 25px;background:#0042da;" valign="middle"> | ||
<a href="${resultUrl}" style="display:inline-block;background:#0042da;color:white;font-family:Helvetica Neue, Helvetica, Helvetica, Arial, sans-serif;font-size:16px;font-weight:500;line-height:23px;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:5px;" target="_blank"> Check results </a> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!--[if mso | IE]></td></tr></table><![endif]--> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!--[if mso | IE]></td></tr></table></td></tr></table><![endif]--> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!--[if mso | IE]></td></tr></table><![endif]--> | ||
</div> | ||
</body> | ||
</html> | ||
` |
Oops, something went wrong.
97980f4
There was a problem hiding this comment.
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 – ./apps/viewer
yoda.riku.ai
bot.tvbeat.it
bot.jesopizz.it
talk.gocare.io
bots.bridge.ai
bergamo.store
chat.hayuri.id
bot.joof.it
app.yvon.earth
gollum.riku.ai
viewer.typebot.io
bot.contakit.com
zap.fundviser.in
fitness.riku.ai
bot.rihabilita.it
bot.dsignagency.com
bot.danyservice.it
chatbot.matthesv.de
demo.wemakebots.xyz
88584434.therpm.club
92109660.therpm.club
bot.barrettamario.it
hello.advergreen.com
bot.coachayongzul.com
bot.eikju.photography
bot.robertohairlab.it
bot.digitalpointer.id
bot.outstandbrand.com
bot.ilmuseoaiborghi.it
criar.somaperuzzo.com
bot.pratikmandalia.com
michaeljackson.riku.ai
87656003.actualizar.xyz
form.bridesquadapp.com
88152257.actualizar.xyz
91375310.actualizar.xyz
arrivalx2.wpwakanda.com
bot.hotelplayarimini.it
invite.bridesquadapp.com
link.venturasuceder.com
bot.amicidisanfaustino.it
forms.hiabhaykulkarni.com
typebot-viewer.vercel.app
chat.thehomebuyersusa.com
casestudyemb.wpwakanda.com
bot.adventureconsulting.hu
chat.atlasoutfittersk9.com
herbalife.barrettamario.it
liveconvert.kandalearn.com
homepageonly.wpwakanda.com
mainmenu1one.wpwakanda.com
tarian.theiofoundation.org
bot.polychromes-project.com
bot.pinpointinteractive.com
liveconvert2.kandalearn.com
bot.seidinembroseanchetu.it
bot.seidibergamoseanchetu.it
forms.escoladeautomacao.com.br
bot.studiotecnicoimmobiliaremerelli.it
viewer-v2-typebot-io.vercel.app
viewer-v2-git-main-typebot-io.vercel.app
97980f4
There was a problem hiding this comment.
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-git-main-typebot-io.vercel.app
landing-page-v2-typebot-io.vercel.app
www.get-typebot.com
typebot.io
www.typebot.io
get-typebot.com
97980f4
There was a problem hiding this comment.
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
sat.cr8.ai
apr.nigerias.io
am.nigerias.io
an.nigerias.io
aso.nigerias.io
apo.nigerias.io
ar.nigerias.io
vhpage.cr8.ai
chat.sureb4.com
bt.id8rs.com
techyscouts.com
bot.piccinato.co
feedback.ofx.one
sakuranembro.it
games.klujo.com
faqs.nigerias.io
eventhub.com.au
bot.upfunnel.art
clo.closeer.work
stan.vselise.com
app.chatforms.net
zap.techadviser.in
voicehelp.cr8.ai
bot.cotemeuplano.com
bot.eventhub.com.au
bot.incusservices.com
chat.hayurihijab.com
forms.webisharp.com
typebot.stillio.com
bot.ansuraniphone.my
c23111azqw.nigerias.io
cdd.searchcube.com.sg
bot.meuesocial.com.br
gcase.barrettamario.it
info.clickasuransi.com
serviziaziendali.online
form.searchcube.com.sg
mainmenu.diddancing.com
kodawariab736.skeep.it
83242573.actualizar.xyz
form.sergiolimajr.com.br
type.opaulovieira.com.br
hunterbot.saleshunter.ai
aibot.angrybranding.co.uk
boyfriend-breakup.riku.ai
type.dericsoncalari.com.br
onboarding.libertydreamcare.ie
piazzatorre.barrettamario.it
type.talitasouzamarques.com.br
agendamento.sergiolimajr.com.br
viewer-v2-alpha-typebot-io.vercel.app
bookings.littlepartymonkeys.com
viewer-v2-alpha-git-main-typebot-io.vercel.app
bot.comercializadoraomicron.com
preagendamento.sergiolimajr.com.br
personal-trainer.barrettamario.it
studiotecnicoimmobiliaremerelli.it
97980f4
There was a problem hiding this comment.
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