Hi,
I am having problems with a client’s website where I am getting an error when I insect the page:
SyntaxError: missing } after function body.
eg: https://www.explorermotorhomes.com.au/our-factory/
This error seems to be affecting certain contact forms and ConvertPlus functionality.
Can you please look at this and let me know how to fix it? I added some code to the function.php file a while back to connect a contact form to mailchimp. it was:
<?php
// =============================================================================
// FUNCTIONS.PHP
// -----------------------------------------------------------------------------
// Overwrite or add your own custom functions to X in this file.
// =============================================================================
// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
// 01. Enqueue Parent Stylesheet
// 02. Additional Functions
// =============================================================================
// Enqueue Parent Stylesheet
// =============================================================================
add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );
// Additional Functions
// =============================================================================
function my_save_to_mailchimp($form)
{
if (!class_exists('MCAPI')) {
require_once dirname(__FILE__) . '/MCAPI.class.php';
}
$api = new MCAPI('0aa66194b324f0e1acbc1b09161a89dd-us8'); $listId = '47ab272d07'; $email = $form->getValue('iphorm_1_5');
// OPTIONAL: if you are saving additional fields to MC, set the merge tags, otherwise set $mergeVars to an empty array
$mergeVars = array(
'FNAME' => $form->getValue('iphorm_1_3'), 'LNAME' => $form->getValue('iphorm_1_4'), );
// Other settings
$emailType = 'html';
$doubleOptin = false;
$updateExisting = false;
$replaceInterests = false;
$sendWelcome = false;
$api->listSubscribe($listId, $email, $mergeVars, $emailType, $doubleOptin, $updateExisting, $replaceInterests, $sendWelcome);
}
add_action('iphorm_post_process_1', 'my_save_to_mailchimp', 10, 1);
Could this be the problem?
Thanks,
Darren.
