Signup forms
You can use HTML forms to let people to sign themselves up to your email marketing list. This is great if you use Lemon Squeezy as your main email marketing tool, rather than just communicating with existing customers.
Use a typical HTML signup form on your website and every submission will be added as a Subscriber in your Lemon Squeezy account.
The endpoint for the form is
https://[STORE].lemonsqueezy.com/email-subscribe/external
where [STORE]
is the URL of your store (configured in your store settings).
Send a POST
request to this endpoint with two variables:
email
- The email address of the subscribername
- (optional) The name of the subscriber
Here's an example form:
When the form is submitted, the subscriber will be redirected to a Lemon Squeezy-hosted confirmation page with a button linking to your storefront.
For more flexibility you can use Javascript to submit the form.
The example code below posts the form using AJAX, which enables changing the post-submission redirect to a custom URL.