docs: update Mailgun configuration with correct sandbox domain

- Update domain to sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org
- Set test email to psbailey31@gmail.com
- Add comprehensive Mailgun setup guide
- Document sandbox authorization requirements
- Create email testing script
- Update troubleshooting documentation

Note: Sandbox domains require recipient authorization in Mailgun dashboard
This commit is contained in:
2025-11-17 00:34:21 +00:00
parent d61c21c54d
commit f82de3621f
5 changed files with 323 additions and 12 deletions

View File

@@ -101,10 +101,23 @@ TEST_EMAIL="test@example.com"
### Mailgun Setup
1. **API Key**: Provided - `dd27be7a81dd7b0980ada31fec9a9bd9-e80d8b76-fd80c63b`
2. **Domain**: Configure your Mailgun domain (currently using sandbox)
3. **From Email**: Set your sender email address
4. **Sandbox Mode**: For testing, add authorized recipients in Mailgun dashboard
1. **API Key**: `dd27be7a81dd7b0980ada31fec9a9bd9-e80d8b76-fd80c63b`
2. **Domain**: `sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org`
3. **From Email**: `Beach Litter Platform <noreply@sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org>`
#### Sandbox Mode Authorization
**IMPORTANT**: Mailgun sandbox domains require you to authorize recipient email addresses before sending.
To authorize recipients:
1. Go to https://app.mailgun.com/
2. Navigate to Sending → Domains
3. Click on your sandbox domain: `sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org`
4. Go to "Authorized Recipients" section
5. Add email addresses you want to test with (e.g., `psbailey31@gmail.com`)
6. Recipients will receive a confirmation email - they must click the link to authorize
**For Production**: Use a verified custom domain instead of sandbox to send to any email address without authorization.
## Testing
@@ -218,11 +231,16 @@ Emails include:
### Emails Not Sending
1. Check Mailgun API key is correct
2. Verify domain is configured in Mailgun
3. Check sandbox mode restrictions (add authorized recipients)
4. Review server logs for error messages
5. Test email service with test script
1. **Check Mailgun API key is correct**: Verify in `.env` file
2. **Verify domain is configured**: Should be `sandbox1835a1917b07443f8c1ca858689c42ea.mailgun.org`
3. **Authorize recipients for sandbox**:
- Go to https://app.mailgun.com/
- Navigate to your sandbox domain
- Add authorized recipients (they must confirm via email)
- Error "Forbidden" means recipient is not authorized
4. **Review server logs**: Check for detailed error messages
5. **Test email service**: Run `npx tsx src/scripts/testEmail.ts`
6. **For production**: Use a verified custom domain to avoid sandbox restrictions
### Notifications Not Appearing