我有一个“电话,一对一”事件类型在Calendly,我想提供一个定制的嵌入脚本。根据文档,我发现location参数/字段可以通过URL预填充电话号码,但是它不适用于这种嵌入代码,它没有预先填充内联小部件。其他一切都进入并填充Calendly小部件。有人知道如何为电话号码字段做这个预填吗?
Calendly.initInlineWidget({
url: 'https://calendly.com/<company_name>/free-consultation-30-mins',
parentElement: document.getElementById('calendly-widget'),
prefill: {
name: form.fname + ' ' + form.lname,
email: vm.form.email,
location: '8184481727',
customAnswers: {
a1: form.other_info,
a2: form.credit_card_debt, // cc debt
a3: form.irs_debt, // how much tax debt,
a4: form.unfiled_returns, // how many unfiled tax returns
a5: form.state // which state
}
},
utm: {}
});发布于 2022-10-07 13:51:16
我在Calendly工作。看起来这是嵌入代码中的一个bug,您应该能够通过prefill对象预先填充位置。修复后我将回发,但建议的解决方法是将location参数直接附加到订票URL,绕过prefill对象:
Calendly.initInlineWidget({
url: 'https://calendly.com/<company_name>/free-consultation-30-mins?location=8184481727',
parentElement: document.getElementById('calendly-widget'),
prefill: {
name: form.fname + ' ' + form.lname,
email: vm.form.email,
customAnswers: {
a1: form.other_info,
a2: form.credit_card_debt, // cc debt
a3: form.irs_debt, // how much tax debt,
a4: form.unfiled_returns, // how many unfiled tax returns
a5: form.state // which state
}
},
utm: {}
});发布于 2022-10-05 06:45:46
因此,我查看了日历嵌入的javascript文件,没有限制它,并发现如下:
getPrefillParams() {
if (!this.options.prefill) return [];
const t = i(this.options.prefill, ["name", "firstName", "lastName", "email", "location"]),
n = e(t, (t, e) => o(e));
if (this.options.prefill.customAnswers) {
const t = this.options.prefill.customAnswers;
Object.entries(t).forEach((t) => {
let [e, r] = t;
e.match(/^a\d{1,2}$/) && (n[e] = r);
});
}
return n;
}我在“电子邮件”之后在数组中添加了"location“,因为它丢失了,而且工作正常。电话号码是预先填好的。
https://stackoverflow.com/questions/73955939
复制相似问题