ueberdosis / vue-mailchimp-subscribe Goto Github PK
View Code? Open in Web Editor NEWRenderless Vue.js component for Mailchimp list subscriptions
License: MIT License
Renderless Vue.js component for Mailchimp list subscriptions
License: MIT License
Hey!
Thanks for this package, I am currently seeing loading forever, and then a timeout, BUT, it does subscribe me successfully, is anyone else seeing this?
I am getting a Cross-Origin Read Blocking (CORB) issue in my console, i wonder if that is blocking.
Thanks
I'm using vue3 and trying to replace the input element with a fancy v-text-field.
However, my try did not work.
<template v-slot="{ subscribe, setEmail, error, success, loading }">
<form @submit.prevent="subscribe">
<v-text-field
label="Your email address"
:rules="rules"
hide-details="auto"
@input="setEmail($event.target.value)"
></v-text-field> -->
<button type="submit"><v-icon>mdi-email</v-icon></button>
<div v-if="error">{{ error }}</div>
<div v-if="success">Sucessfully subscribed!</div>
<div v-if="loading">Loading…</div>
</form>
</template>
Error:
"TypeError: Cannot read property 'value' of undefined"
I would be happy if you can provide advice.
There is a syntax error thrown by a package you're using called split-on-first.
sindresorhus/split-on-first#6
Maybe you could use something else?
Hi,
i'am getting the following error from javascript console.
Can you please tell me how to solve?
Thanks
any documentation about how to get the url, list id & user-id ?
import r from 'jsonp'
import s from 'query-string'
export default {
props: {
url: {
required: !0,
type: String
},
userId: {
required: !0,
type: String
},
listId: {
required: !0,
type: String
},
language: {
required: !0,
type: String
}
},
data: function () {
return {
email: null,
success: !1,
error: null,
loading: !1
}
},
computed: {
data: function () {
return s.stringify({
u: this.userId,
id: this.listId,
EMAIL: this.email,
LANGUAGE: this.language
})
}
},
methods: {
setEmail: function (r) {
void 0 === r && (r = ''), this.email = r.trim()
},
subscribe: function () {
null === this.email || this.loading || (this.success = !1, this.error = null, this.loading = !0, r(this.url + '?' + this.data, { param: 'c' }, this.onResponse))
},
onResponse: function (r, s) {
this.loading = !1, r && (this.error = r), s && 'error' === s.result && (this.error = this.formatErrorMessage(s.msg)), this.error ? this.$emit('error', this.error) : (this.success = !0, this.email = null, this.$emit('success'))
},
formatErrorMessage: function (r) {
return r.replace('0 - ', '')
}
},
render: function () {
return this.$scopedSlots.default({
subscribe: this.subscribe,
setEmail: this.setEmail,
error: this.error,
success: this.success,
loading: this.loading
})
}
}
//# sourceMappingURL=vue-mailchimp-subscribe.mjs.map
and on component
<mailchimp-subscribe
url="https://xxxxxxxxxxxxx.us1.list-manage.com/subscribe/post-json"
user-id="xxxxxxxxx"
list-id="xxxxxxxxxx"
language="fr_CA"
>
Add the ability to subscribe with additional fields - not just email.
I have forms that collect city, state, business name, etc.
Possibly change function from setEmail to setField('EMAIL')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.