Closed ellimondo closed 3 years ago
Please excuse my ignorance if I have missed something glaring here as this is the first time I've used Statamic. It's also unclear in the instructions what the handle is for a form. Is it the name of the YAML file in resources/forms?
Yes, name of the YAML. Sorry for the confusion, I'll update the instructions.
Closed in https://github.com/edalzell/statamic-mailchimp/commit/62a9d5a35534db7bed63f5b308b6907b58bab11e
Thanks for the updates. All work great. However, I am still getting the error from the function addFormsToNewsletterConfig
listed above. The settings inside the config file are being viewed as Illegal String Offset and highlight this line in the CP.
return [$form['form'] => ['id'=> $form['audience_id']]];
@ellimondo let's see your config file
Here you go. The settings are just for testing.
Even if I only enter the form setting in a freshly generated mailchimp.php
file the error is thrown as soon as the array is called in line 50. I've run a composer update statamic/cms
to see if anything is missing but it's all tickety boo.
<?php
return [
'add_new_users' => false,
'forms' => [
'audience_id' => '2d64ff86d3',
'check_consent' => false,
'consent_field' => 'consent',
'form' => 'contact',
'merge_fields' => [
[
'tag'=> 'EMAIL',
'field_name' => 'email'
],
[
'tag'=> 'FNAME',
'field_name' => 'first_name'
],
[
'tag'=> 'LNAME',
'field_name' => 'surname'
]
],
'disable_opt_in' => true,
],
];
Bad example config file, sorry, try this:
<?php
return [
'add_new_users' => false,
'forms' => [[
'audience_id' => '2d64ff86d3',
'check_consent' => false,
'consent_field' => 'consent',
'form' => 'contact',
'merge_fields' => [
[
'tag'=> 'EMAIL',
'field_name' => 'email'
],
[
'tag'=> 'FNAME',
'field_name' => 'first_name'
],
[
'tag'=> 'LNAME',
'field_name' => 'surname'
]
],
'disable_opt_in' => true,
]],
];
If I paste the suggested code from the Readme file into the mailchimp.php file I get the following error in Statamic:
I think there's a missing
],
in the example.If I repair this and fill out the config I still get errors:
Please excuse my ignorance if I have missed something glaring here as this is the first time I've used Statamic. It's also unclear in the instructions what the handle is for a form. Is it the name of the YAML file in resources/forms?