Back
James Dawson
James Dawson
Create a newsletter site for free in 30 minutes

Create a newsletter site for free in 30 minutes

We will create a Newsletter website in Nuxt in less than 30 minutes!

nuxtresendweb development

Initial Setup

We need to create a new project.

Loading...

Then we open our nuxt.config.ts file. And replace it with the following.

tailwind.config.js
Loading...

Run the setup CLI.

Loading...

And finally just follow the default steps. Make sure you select your framework as Nuxt

nuxt setup
Loading...

That is all the setup done! All we need to do now is add the input and button components.

Loading...

Build a basic app

Amazing, now let’s make ourselves a quick landing page. Replace the following code in your app.vue file.

app.vue
Loading...

This should all do the job! We now need an endpoint to send the signup request to, along with the users actual email address.

Backend with Resend

Now we can implement Resends logic. First we need create an account with Resend and get your API key.

Once you have your API key. You should create a .env file at the root of your directory and add the API key here.

.env
Loading...

Now we need to create an endpoint that will handle adding the email address to our resend audience and sending them a thankyou email.

Create a new file in server/api/newsletter.post.ts and add the following code.

newsletter.post.ts
Loading...

Finally all that is left to do is to hook the frontend up to this api call

app.vue
Loading...

Now just add this function to your current frontend

app.vue
Loading...

And we have a working newsletter!