form not working

25 replies · opened Dec 28, 2023

WwinkwebDec 28, 2023

Hi,

I have 2 issues:

Issue 1: CONTACT FORM
It's not going through. I'm not getting the success/error message.

Issue 2: MAILCHIMP subscription embed form
It's not working either

Can you please help me?

WwinkwebDec 29, 2023

UPDATE

Issue 2: MAILCHIMP subscription embed form
I added the apikey and audience id to "subscribe.php" but it's still not working.

WwinkwebDec 29, 2023

subscribe.php file attached

WwinkwebDec 29, 2023

I just had a 2 hour chat with mailchimp, and they believe the conflict is coming from the template, they weren't able to solve it.

WwinkwebDec 29, 2023

mailchimp answer

WwinkwebDec 29, 2023

form php file attached too just in case

SSemicolon WebSTAFFJan 2, 2024

Hello,

Thanks for your Patience!

We have checked this out and the issue appears to be with the Form Codes you are using since neither of them are related to Canvas. Please consider adding the Contact Form and Subscription Form Codes for Canvas and then provide us with a Live URL so that we can check this out for you and fix this.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

WwinkwebJan 2, 2024

Hi,

Yes, I know they're not from Canvas, but my client wants to have a mailchimp subscription form.
There should be a way to solve the mailchimp issue.

Where do I find the Canvas version of the mailchimp subscription form? I can't find it.

Thanks,
Mariana

SSemicolon WebSTAFFJan 9, 2024

Hello,

Thanks for your Kind Patience!

Consider using this code to get started with:
[ch_pre]






Subscribe Today!
Your Information is secure with us


[/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFJan 11, 2024

Hello,

Please make sure that you are adding the following details in the include/subscribe.php File from your Mailchimp Account:
[ch_pre type="php"]$apiKey = ''; // Your MailChimp API Key
$listId = ''; // Your MailChimp List ID[/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

WwinkwebJan 13, 2024

I added the info above, but it still doesn't work, I get "INVALID RESOURCE".
See screenshot attached.

Using the code in this page in the footer:
https://marianamariana.com/clean/about.html

I just spoke to mailchimp support and my APIkey + ListId are correct

WwinkwebJan 13, 2024

I have a unique audience id

<?php

$apiKey = '645dbf10ef3e3cb63df0507d559d8bc7-us4'; // Your MailChimp API Key
$listId = 'b531318167'; // Your MailChimp List ID

if( isset( $_GET['list'] ) AND $_GET['list'] != '' ) {
$listId = $_GET['list'];
}

$email = $_POST['widget-subscribe-form-email'];
$fname = isset( $_POST['widget-subscribe-form-fname'] ) ? $_POST['widget-subscribe-form-fname'] : '';
$lname = isset( $_POST['widget-subscribe-form-lname'] ) ? $_POST['widget-subscribe-form-lname'] : '';
$datacenter = explode( '-', $apiKey );
$submit_url = "https://columbusfoodtruckfest.us4.list-manage.com/subscribe/post?u=ea46a0003141d5d7f16c8c533&id=b531318167&f_id=002f8debf0" . $datacenter[1] . ".api.mailchimp.com/3.0/lists/" . $listId . "/members/" ;

if( isset( $email ) AND $email != '' ) {

$merge_vars = array();
if( $fname != '' ) { $merge_vars['FNAME'] = $fname; }
if( $lname != '' ) { $merge_vars['LNAME'] = $lname; }

$data = array(
	'email_address' =&gt; $email,
	'status' =&gt; 'subscribed'
);

if( !empty( $merge_vars ) ) { $data['merge_fields'] = $merge_vars; }

$payload = json_encode($data);

$auth = base64_encode( 'user:' . $apiKey );

$header   = array();
$header[] = 'Content-type: application/json; charset=utf-8';
$header[] = 'Authorization: Basic ' . $auth;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $submit_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

$result = curl_exec($ch);
curl_close($ch);
$data = json_decode($result);

if ( isset( $data-&gt;status ) AND $data-&gt;status == 'subscribed' ){
	echo '{ "alert": "success", "message": "You have been **successfully** subscribed to our Email List." }';
} else {
	echo '{ "alert": "error", "message": "' . $data-&gt;title . '" }';
}

}

?>

WwinkwebJan 13, 2024

After using the code above in the subscribe.php file - the emails are still not going through.

After submitting an email I now get a message that says "Please set a message!"

The emails are not showing on my mailchimp account either

SSemicolon WebSTAFFJan 15, 2024

Hello,

The Codes look fine but it appears there is some issue with either the Server Configurations or a PHP Error. Would it be possible for you to provide us with FTP Credentials in a private reply, so that we can check this for you and fix it? Thanks for your Patience.

Additionally, we can see in the above codes that you have customized the PHP and the following line is causing issues:
[ch_pre type="php"]$submit_url = "https://columbusfoodtruckfest.us4.list-manage.com/subscribe/post?u=ea46a0003141d5d7f16c8c533&id=b531318167&f_id=002f8debf0&#8221; . $datacenter[1] . ".api.mailchimp.com/3.0/lists/" . $listId . "/members/" ;[/ch_pre]

Which should be replaced with this:
[ch_pre type="php"]$submit_url = "https://" . $datacenter[1] . ".api.mailchimp.com/3.0/lists/" . $listId . "/members/";[/ch_pre]

This should fix the issue but if it does, we will recommend providing us with your FTP Credentials so that we can check further.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

WwinkwebJan 15, 2024

The above change is what I used to have, and that was giving me the "Invalid Resource" message

FTP credentials:

PATH:
/marianamariana.com/public_html/clean/

ACCOUNT NAME:
canvas24@marianamariana.com

PASSWORD:
111$2#c_47o4

thank you

SSemicolon WebSTAFFJan 16, 2024

Hello,

We have fixed this issue for you but it appears that the issue was due to the Customizations in your Mailchimp list that has Custom Fields which required Custom Edits in the include/subscribe.php and also the JS does not appear to be working which we are not sure why as it will require a lot of checks due to the amount of Customization involved.

We have checked our Live Previews and the Latest Codes provided currently works perfectly fine: https://canvastemplate.com/left-sidebar.html .

So unfortunately, fixing this will require Customization Services due to a lot of checks involved and code correcting. Let us know if you need more Customized Support for this.

Thanks for your Kind Patience.

Let us know if we can help you with anything else or if you find any further issues.

WwinkwebJan 16, 2024

Hello,

I'm confused, the form doesn't seem to be working.
How can we solve this issue? Can you please tell me what I need to do on the mailchimp side?

I tried subscribing right now, and after clicking "subscribe" I got a page with a string of code. I can't have that.

This is the only issue tha'ts preventing me from uploading my site. Can you please help me out?
The JS issues is coming from your side.

Thank you,
Mariana

SSemicolon WebSTAFFJan 16, 2024

Hello,

Thanks for your Patience!

We have fixed the issue with the String of Code displaying. Now, the only issue is the JS Codes are not working as expected and this is likely due to a Customization Issue. Since, currently Customization related Support is not included with the License according to the Item Support Policy: https://themeforest.net/page/item_support_policy and https://support.semicolonweb.com/support-policy/ . You will need to manually code this or Hire Us to help you out with Customizations.

Thanks for Understanding.

Let us know if we can help you with anything else or if you find any further issues.

WwinkwebJan 16, 2024

The emails are coming in, but this is how the messages are showing (see screenshot attached).
Can you please help fix this?

WwinkwebJan 16, 2024

Customization issue where though?
I only copied and pasted the block.
How do I hire you for customizations?

SSemicolon WebSTAFFJan 17, 2024

Hello,

Yes, this is because the JS Functionality is not working as expected. You can consider removing the .customjs Class from the .subscribe-widget Element and you will notice that the JS is not working as expected.

We have just checked and it appears that the Subscription Form is currently working with JS and displaying the Success and Error Message appropriately.

We will send you an Email shortly if you need Customizations.

Let us know if we can help you with anything else or if you find any further issues.

WwinkwebJan 18, 2024

I copied and pasted the code from the "left-sidebar.html" file, and this time it worked.
Maybe the file I had originally used has an issue?

I don't know any js, so I hadn't touched any of those files

SSemicolon WebSTAFFJan 19, 2024

Hello,

Apologies for the Inconveniences caused!

Yes, this could be a possibility. Please let us know which File you had copied/pasted the Codes from so that we can check and fix if there is an issue. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard