-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(website): newsletter popup (#778)
- Loading branch information
1 parent
b03114d
commit 26b968c
Showing
29 changed files
with
250 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,12 @@ | |
"submit-button": "Beim Newsletter anmelden", | ||
"newsletter-updated-toast": "Du wurdest zum Newsletter hinzugefügt", | ||
"newsletter-error-toast": "Du konntest leider nicht zum Newsletter hinzugefügt werden" | ||
}, | ||
"popup": { | ||
"information-label": "Melde dich für unseren Newsletter an und werde Teil der Social Income Community!", | ||
"toast-success": "Danke für das Abonnieren des Social Income Newsletters!", | ||
"toast-failure": "Oops! Etwas ist schief gelaufen. Bitte versuche es nochmals, oder kontaktiere uns auf [email protected]", | ||
"email-placeholder": "Deine E-Mail Adresse", | ||
"button-subscribe": "Abonnieren" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -18,5 +18,12 @@ | |
"submit-button": "Subscribe to newsletter", | ||
"newsletter-updated-toast": "You have been added to the newsletter", | ||
"newsletter-error-toast": "We weren't able to add you to our newsletter" | ||
}, | ||
"popup": { | ||
"information-label": "Join our newsletter and become part of the Social Income Community!", | ||
"toast-success": "Thank you for subscribing to our newsletter!", | ||
"toast-failure": "Something went wrong. Try again or contact us at [email protected]", | ||
"email-placeholder": "Your email", | ||
"button-subscribe": "Subscribe" | ||
} | ||
} |
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,21 @@ | ||
# These environment variables are required so that the Firebase Admin SDK (server side) connects to the local emulator. | ||
GCLOUD_PROJECT="social-income-staging" | ||
FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 | ||
FIREBASE_AUTH_EMULATOR_HOST=127.0.0.1:9099 | ||
|
||
# These environment variables are required so that the Firebase JS SDK (client side) connects to the local emulator. | ||
NEXT_PUBLIC_FIREBASE_API_KEY="demo-key" | ||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="social-income-staging" | ||
NEXT_PUBLIC_FIREBASE_PROJECT_ID="social-income-staging" | ||
NEXT_PUBLIC_FIREBASE_AUTH_EMULATOR_URL="http://localhost:9099" | ||
NEXT_PUBLIC_FIREBASE_FIRESTORE_EMULATOR_HOST="localhost" | ||
NEXT_PUBLIC_FIREBASE_FIRESTORE_EMULATOR_PORT="8080" | ||
NEXT_PUBLIC_FIREBASE_FUNCTIONS_EMULATOR_HOST="localhost" | ||
NEXT_PUBLIC_FIREBASE_FUNCTIONS_EMULATOR_PORT="5001" | ||
|
||
BASE_URL="http://localhost:3001" | ||
|
||
MAILCHIMP_LIST_ID="11223344" | ||
MAILCHIMP_API_KEY="ABC*************" | ||
MAILCHIMP_SERVER="us11" | ||
|
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
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
2 changes: 1 addition & 1 deletion
2
...lang]/[region]/(website)/updates/page.tsx → ...g]/[region]/(website)/newsletter/page.tsx
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
2 changes: 1 addition & 1 deletion
2
.../src/app/[lang]/[region]/(website)/transparency/finances/[currency]/currency-redirect.tsx
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
2 changes: 1 addition & 1 deletion
2
website/src/app/[lang]/[region]/(website)/transparency/finances/page.tsx
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
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
15 changes: 0 additions & 15 deletions
15
website/src/app/api/mailchimp/subscription/public/route.ts
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
website/src/app/api/newsletter/subscription/public/route.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,16 @@ | ||
import { MailchimpAPI, NewsletterSubscriptionData } from '@socialincome/shared/src/mailchimp/MailchimpAPI'; | ||
|
||
export type CreateNewsletterSubscription = Omit<NewsletterSubscriptionData, 'status'>; | ||
type CreateNewsletterSubscriptionReqeust = { json(): Promise<CreateNewsletterSubscription> } & Request; | ||
|
||
export async function POST(request: CreateNewsletterSubscriptionReqeust) { | ||
const data = await request.json(); | ||
const mailchimpAPI = new MailchimpAPI(process.env.MAILCHIMP_API_KEY!, process.env.MAILCHIMP_SERVER!); | ||
try { | ||
await mailchimpAPI.createSubscription({ ...data, status: 'subscribed' }, process.env.MAILCHIMP_LIST_ID!); | ||
return new Response(null, { status: 200 }); | ||
} catch (e: any) { | ||
console.error(e); | ||
return new Response(null, { status: 405, statusText: e }); | ||
} | ||
} |
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
Oops, something went wrong.