like-gold
like-gold2mo ago

auto launch chat bot from email signature link

Has anyone embedded a link within an email block signature that will open up a chat bot? I have someone who wants to place a link inside their email signature 'chat with us here' and he wants this to launch the bot. Apart from building a separate landing page for the bot to reside in and launch within, is there a URL that will launch the bot on his site? I reckon the easiest thing is to populate the url with his website and auto-launch the bot within it.
1 Reply
Tico | Voiceflow Assistant
You can’t create a “Voiceflow-only” URL that runs the chat on its own – the widget always lives inside a page you host – but you can load that page and programmatically pop the widget open as soon as it finishes loading. 1. Embed the normal web-chat snippet on the page you’ll link to:
<script>(function(d,t){
var v=d.createElement(t),s=d.getElementsByTagName(t)[0];
v.onload=function(){
window.voiceflow.chat.load({
verify: { projectID: 'YOUR_PROJECT_ID' },
url: 'https://general-runtime.voiceflow.com',
versionID: 'production'
}).then(() => {
// open the widget immediately
window.voiceflow.chat.open();
});
};
v.src='https://cdn.voiceflow.com/widget/bundle.mjs';
v.type='text/javascript';
s.parentNode.insertBefore(v,s);
})(document,'script');</script>
<script>(function(d,t){
var v=d.createElement(t),s=d.getElementsByTagName(t)[0];
v.onload=function(){
window.voiceflow.chat.load({
verify: { projectID: 'YOUR_PROJECT_ID' },
url: 'https://general-runtime.voiceflow.com',
versionID: 'production'
}).then(() => {
// open the widget immediately
window.voiceflow.chat.open();
});
};
v.src='https://cdn.voiceflow.com/widget/bundle.mjs';
v.type='text/javascript';
s.parentNode.insertBefore(v,s);
})(document,'script');</script>
2. Point the email-signature link to that page.
Example: https://your-site.com/chat. 3. (Optional) Only auto-open when the visitor comes from the email by adding a query flag: • Email link → https://your-site.com/?openchat=true
• JS check:
const params = new URLSearchParams(window.location.search);
if (params.get('openchat') === 'true') {
window.voiceflow.chat.open();
}
const params = new URLSearchParams(window.location.search);
if (params.get('openchat') === 'true') {
window.voiceflow.chat.open();
}
The key call is window.voiceflow.chat.open() (part of the Custom Triggers API), which programmatically opens the widget once chat.load() resolves. Docs: Custom triggers & .open() method – https://docs.voiceflow.com/docs/custom-triggers

Did you find this page helpful?