Skip to content

Commit 1624a86

Browse files
Copilotbobbyiliev
andcommitted
Replace NEXT_PUBLIC_BREVO_FORM_URL env var with hardcoded constant in lib/newsletter.ts
Co-authored-by: bobbyiliev <21223421+bobbyiliev@users.noreply.github.com>
1 parent a3341b2 commit 1624a86

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ WATCHPACK_POLLING=true
1717

1818
# Optional: API Keys (if needed)
1919
# OPENAI_API_KEY=your_api_key_here
20-
21-
# Brevo (newsletter) — set to your Brevo subscription form URL
22-
# e.g. https://sibforms.com/serve/MUIFAAAA...
23-
# NEXT_PUBLIC_BREVO_FORM_URL=https://sibforms.com/serve/YOUR_FORM_ID_HERE

app/books/devops-survival-guide/client-content.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
44
import { Button } from '@/components/ui/button';
55
import { Badge } from '@/components/ui/badge';
66
import { Card, CardDescription, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
7+
import { BREVO_FORM_URL } from '@/lib/newsletter';
78
import {
89
BookOpen,
910
Rocket,
@@ -525,7 +526,7 @@ export function ClientContent() {
525526
<div className="max-w-md mx-auto">
526527
<div className="p-8 bg-linear-to-br from-primary/5 to-purple-500/5 border-2 border-primary/20 rounded-2xl shadow-2xl backdrop-blur-sm">
527528
<form
528-
action={process.env.NEXT_PUBLIC_BREVO_FORM_URL ?? '#'}
529+
action={BREVO_FORM_URL}
529530
method="post"
530531
target="_blank"
531532
noValidate

components/book-promotion-popup.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { motion, AnimatePresence } from 'framer-motion'
55
import { BookOpen, X, Sparkles } from 'lucide-react'
66
import { Button } from '@/components/ui/button'
77
import Confetti from 'react-confetti'
8+
import { BREVO_FORM_URL } from '@/lib/newsletter'
89

910
export function BookPromotionPopup() {
1011
const [isVisible, setIsVisible] = useState(false)
@@ -157,7 +158,7 @@ export function BookPromotionPopup() {
157158

158159
<form
159160
onSubmit={handleSubscribe}
160-
action={process.env.NEXT_PUBLIC_BREVO_FORM_URL ?? '#'}
161+
action={BREVO_FORM_URL}
161162
method="post"
162163
target="_blank"
163164
className="space-y-2"

components/footer/newsletter-form.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Mail, ArrowRight } from 'lucide-react';
2+
import { BREVO_FORM_URL } from '@/lib/newsletter';
23

34
export function NewsletterForm() {
4-
const brevoFormUrl = process.env.NEXT_PUBLIC_BREVO_FORM_URL ?? '#';
5-
65
return (
76
<div className="p-6 bg-linear-to-br from-primary/5 to-purple-500/5 border border-primary/20 rounded-2xl shadow-lg">
87
<div className="flex items-center gap-2 mb-3">
@@ -13,7 +12,7 @@ export function NewsletterForm() {
1312
Get the latest DevOps insights delivered to your inbox weekly.
1413
</p>
1514
<form
16-
action={brevoFormUrl}
15+
action={BREVO_FORM_URL}
1716
method="post"
1817
target="_blank"
1918
noValidate

components/sponsor-sidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { cn } from '@/lib/utils';
44
import { Clock, Sparkles, ExternalLink } from 'lucide-react';
55
import { CarbonAds } from '@/components/carbon-ads';
66
import { sponsors } from '@/lib/sponsors';
7+
import { BREVO_FORM_URL } from '@/lib/newsletter';
78

89
interface SponsorSidebarProps {
910
className?: string;
@@ -98,7 +99,7 @@ export function SponsorSidebar({ className, relatedPosts = [] }: SponsorSidebarP
9899
Get the latest DevOps tips and tutorials delivered to your inbox.
99100
</p>
100101
<form
101-
action={process.env.NEXT_PUBLIC_BREVO_FORM_URL ?? '#'}
102+
action={BREVO_FORM_URL}
102103
method="post"
103104
target="_blank"
104105
noValidate

lib/newsletter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Brevo subscription form URL.
3+
* This is a public URL — it is safe to commit and requires no environment variable.
4+
* To find yours: Brevo dashboard → Email → Subscription Forms → your form → Share.
5+
*/
6+
export const BREVO_FORM_URL = 'https://sibforms.com/serve/YOUR_FORM_ID_HERE';

0 commit comments

Comments
 (0)