feat: Custom fields in pre-chat form (#4135)

Fixes: #2744
This commit is contained in:
Muhsin Keloth 2022-03-14 15:06:56 +05:30 committed by GitHub
parent 578414d788
commit e730804b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 328 additions and 137 deletions

View file

@ -35,13 +35,20 @@ export default {
},
},
methods: {
onSubmit({ fullName, emailAddress, message, activeCampaignId }) {
onSubmit({
fullName,
emailAddress,
message,
activeCampaignId,
phoneNumber,
}) {
if (activeCampaignId) {
bus.$emit('execute-campaign', activeCampaignId);
this.$store.dispatch('contacts/update', {
user: {
email: emailAddress,
name: fullName,
phone_number: phoneNumber,
},
});
} else {
@ -49,6 +56,7 @@ export default {
fullName: fullName,
emailAddress: emailAddress,
message: message,
phoneNumber: phoneNumber,
});
}
},