Customizing The Subscription Form
Files: src/config/config.toml, src/i18n/<lang>.json · Skill level: Beginner
The subscription form in the footer lets visitors join your Mailchimp list. To configure it, open src/config/config.toml and find this section:
[settings.subscription] enable = true title = "" # Replace with your own Mailchimp list URL before deploying formAction = "https://your-account.us1.list-manage.com/subscribe/post?u=YOUR_USER_ID&id=YOUR_LIST_ID&f_id=YOUR_FORM_ID"enable→ Shows or hides the subscription form.formAction→ The action URL of your Mailchimp form. The value in the file is a placeholder, and nothing warns you about it.title→ Looka’s footer doesn’t show this value. See below for the text above the form.
In the Tina edition, these are under Site settings > Settings > Subscription at /admin/. In the Sanity edition, they are in the same place under Site settings in the Studio.
The Text Above The Form
The text above the form is in each language file, so it can change with the language. Change it in every language:
"subscription": { "label": "Subscribe to our newsletter for the latest updates"}In the Tina and Sanity editions, it is Interface labels > Subscription > Label.
Getting Mailchimp Subscription Form Action URL
Currently, we are using Mailchimp for our subscription form. You can find the form action URL in the Mailchimp dashboard. Follow the steps below to get the form action URL:
Create a Mailchimp Account
If you don’t already have a Mailchimp account, sign up at mailchimp.com or log in if you have one.
Create an Embedded Form
After logging in, you will see the dashboard. From the left sidebar, click the
Createbutton located at the top.
Then click
Signup Form, thenEmbedded Form, and fill out the form before clickingBegin.
After you click
Begin, you will see a page where you can add more fields. Now, from the top right, click theContinuebutton.
You will then see the following page. From the embedded form code, copy the
form actionvalue and paste it into theconfig.tomlfile under theformActionoption. The embed code writes&between parameters: change each one to a plain&.
Ready to try? Fill out and submit the subscription form to test it.