Ad-report admin recipient via ADMIN_EMAIL env only (siteConfig is public)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -715,7 +715,7 @@ const server = http.createServer(async (req, res) => {
|
|||||||
const who = (s && s.email) || '';
|
const who = (s && s.email) || '';
|
||||||
const rec = await reports.add(b.campaignId, who, b.reason, b.note);
|
const rec = await reports.add(b.campaignId, who, b.reason, b.note);
|
||||||
try {
|
try {
|
||||||
const adminEmail = siteConfig().adminEmail || process.env.ADMIN_EMAIL || '';
|
const adminEmail = process.env.ADMIN_EMAIL || ''; // private env only — siteConfig is exposed via /api/config
|
||||||
if (adminEmail && mailer.hasKey()) {
|
if (adminEmail && mailer.hasKey()) {
|
||||||
mailer.send(adminEmail, 'Ad reported on InstantAdPay (campaign #' + rec.campaignId + ')',
|
mailer.send(adminEmail, 'Ad reported on InstantAdPay (campaign #' + rec.campaignId + ')',
|
||||||
'A member flagged an ad.\n\nCampaign: #' + rec.campaignId + '\nReason: ' + rec.reason
|
'A member flagged an ad.\n\nCampaign: #' + rec.campaignId + '\nReason: ' + rec.reason
|
||||||
|
|||||||
Reference in New Issue
Block a user