Skip to content

Commit b3bc4d8

Browse files
committed
fix
1 parent 3938608 commit b3bc4d8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CORS_ALLOWED_ORIGINS="*"
1010
CORS_ALLOWED_HEADERS="Accept,Authorization,Content-Type"
1111
CORS_ALLOWED_METHODS="GET,POST,PUT,PATCH,DELETE,OPTIONS"
1212

13-
SMTP_HOST=""
14-
SMTP_PORT=""
15-
SMTP_EMAIL=""
16-
SMTP_PASSWORD=""
13+
SMTP_HOST="[email protected]"
14+
SMTP_PASSWORD="123456"
15+
SMTP_PORT="587"
16+
SMTP_EMAIL="smtp.gmail.com"

pkg/email/example.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ func sendOrderConfirmation(ctx context.Context, orderID string) error {
160160

161161
// SMTP configuration
162162
smtpConfig := SMTP{
163-
Email: "orders@company.com",
164-
Password: os.Getenv("SMTP_PASSWORD"),
165-
Host: "smtp.gmail.com",
166-
Port: "587",
163+
Email: os.Getenv("SMTP_EMAIL"), // e.g., "noreply@company.com"
164+
Password: os.Getenv("SMTP_PASSWORD"), // e.g., "your-app-password"
165+
Host: os.Getenv("SMTP_HOST"), // e.g., "smtp.gmail.com"
166+
Port: os.Getenv("SMTP_PORT"), // e.g., "587"
167167
}
168168

169169
// Create email payload
@@ -265,10 +265,10 @@ func sendNewsletter(ctx context.Context) error {
265265

266266
// SMTP configuration
267267
smtpConfig := SMTP{
268-
Email: "newsletter@company.com",
269-
Password: os.Getenv("SMTP_PASSWORD"),
270-
Host: "smtp.gmail.com",
271-
Port: "587",
268+
Email: os.Getenv("SMTP_EMAIL"), // e.g., "noreply@company.com"
269+
Password: os.Getenv("SMTP_PASSWORD"), // e.g., "your-app-password"
270+
Host: os.Getenv("SMTP_HOST"), // e.g., "smtp.gmail.com"
271+
Port: os.Getenv("SMTP_PORT"), // e.g., "587"
272272
}
273273

274274
// Create email payload
@@ -377,10 +377,10 @@ func sendPasswordReset(ctx context.Context, userEmail, resetToken string) error
377377
}
378378

379379
smtpConfig := SMTP{
380-
Email: "security@company.com",
381-
Password: os.Getenv("SMTP_PASSWORD"),
382-
Host: "smtp.gmail.com",
383-
Port: "587",
380+
Email: os.Getenv("SMTP_EMAIL"), // e.g., "noreply@company.com"
381+
Password: os.Getenv("SMTP_PASSWORD"), // e.g., "your-app-password"
382+
Host: os.Getenv("SMTP_HOST"), // e.g., "smtp.gmail.com"
383+
Port: os.Getenv("SMTP_PORT"), // e.g., "587"
384384
}
385385

386386
emailPayload := NewSendEmail(

0 commit comments

Comments
 (0)