-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
110 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './articles'; | ||
export * from './get-image-url'; | ||
export * from './newsletter'; | ||
export * from './sdk-client'; |
11 changes: 11 additions & 0 deletions
11
apps/frontend/src/directus/newsletter/create-newsletter-user.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createItem } from '@directus/sdk'; | ||
|
||
import { directusSdk } from '../sdk-client'; | ||
|
||
export function createNewsletterUser(email: string) { | ||
return directusSdk.request( | ||
createItem('Newsletter_List', { | ||
email, | ||
}), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './create-newsletter-user'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
import { Mail } from 'lucide-astro'; | ||
interface Props { | ||
errors: string[]; | ||
} | ||
const { errors } = Astro.props; | ||
--- | ||
<div class="mt-8 p-6 bg-gray-100 rounded-lg"> | ||
<h2 class="text-xl font-bold mb-4">Subscribe to our Newsletter</h2> | ||
<p class="mb-4"> | ||
Stay updated with the latest articles, tips, and exclusive promotions. Subscribe to our newsletter and never miss out on the best content for AI lovers! | ||
</p> | ||
<form method="post" class="flex flex-col gap-4"> | ||
<input | ||
type="email" | ||
name="email" | ||
placeholder="Enter your email" | ||
class="p-3 border border-gray-300 rounded-lg" | ||
required | ||
/> | ||
<button | ||
type="submit" | ||
class="p-3 bg-black text-white font-bold rounded-lg hover:bg-gray-800 flex items-center justify-center gap-2" | ||
> | ||
<Mail class="h-5 w-5" /> | ||
|
||
Subscribe | ||
</button> | ||
|
||
{errors.length > 0 && ( | ||
<div class="mt-4 p-4 bg-red-100 text-red-700 rounded-lg"> | ||
{errors.map(error => <p>{error}</p>)} | ||
</div> | ||
)} | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
import DefaultLayout from '~/layouts/default-layout.astro'; | ||
--- | ||
|
||
<DefaultLayout | ||
title="Thank You for Subscribing!" | ||
description="You have successfully subscribed to our newsletter." | ||
> | ||
<section class="container mx-auto px-4 py-8"> | ||
<div class="text-center"> | ||
<h1 class="text-3xl font-bold mb-4">Thank You for Subscribing!</h1> | ||
<p class="mb-4">You have successfully subscribed to our newsletter. Stay tuned for the latest updates and exclusive content.</p> | ||
<a href="/blog" class="text-blue-500 hover:underline">Go back to Blog</a> | ||
</div> | ||
</section> | ||
</DefaultLayout> |