wordpress plugin issue: Unexpected end of JSON input
I am getting this error from the wordpress widget of this plugin
Unexpected end of JSON input
Just to verify, are you running Mailtrain v1.23.2 plus this patch? Also, when checking your browsers DevTools Console, is there any more info?
Mailtrain version is v.1.23.2. Not sure about the patch as I am running on cloudron.
I was getting a different browser error earlier, something more like err name resolution. now getting this
(index):1 XMLHttpRequest cannot load https://marketing.pompom.com.bd/subscription/SJy5k0fhe/widget. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://futurestartup.com' is therefore not allowed access. The response had HTTP status code 403.
You need to enable CORS:
- Enable cross-origin resource sharing in your Mailtrain config file and whitelist your site
Yet I'm not sure if you're able to edit the config file on cloudron ...
Its enabled in my installation and the website is whitelisted.
http://futurestartup.com is not in your whitelist, only http://www.futurestartup.com is.
Your config should look like this:
[cors]
# Allow subscription widgets to be embedded
origins=["http://futurestartup.com", "http://www.futurestartup.com"]
Still, if you want widgets to work with custom forms, you need the patch mentioned above.
Hi, I have modified the config file and it now looks like the above. However, now getting this on browser console
OPTIONS https://marketing.pompom.com.bdsubscription/SJy5k0fhe/subscribe net::ERR_NAME_NOT_RESOLVED
sendForm @ widget.js?ver=4.7.3:102
(anonymous) @ widget.js?ver=4.7.3:141
it seems the list url is missing a / after .com.bd
it seems the list url is missing a / after .com.bd
Yeah, the cause is here, yet the ServiceURL in Mailtrain should actually save with a trailing slash.
On your Mailtrain Settings Page, could you verify (or manually add) the trailing slash to your Service URL?
Adding a slash solves the issue. Thanks.