This repository is alinged with the tutorial to build email templates using Stortblok and Next.js.
This is a Next.js project bootstrapped with create-next-app
.
To use this project you have to have a Storyblok account. If you don't have one yet you can register at Storyblok, it's free.
$ git clone https://github.com/storyblok/building-email-templates-tutorial
$ yarn # or npm install
Create a new empty Space and exchange the preview token with your own in app/layout.js
as well as in api/send/route.js
.
storyblokInit({
accessToken: "your-preview-token",
// for spaces located in the US:
// apiOptions: {
// region: "us",
// },
use: [apiPlugin],
components,
});
Set the preview domain in Storyblok to http://localhost:3000/
# to run in developer mode
$ yarn dev # or npm run dev
# to build your project
$ yarn build # or npm run build