everydaytok commited on
Commit
475cd2c
·
verified ·
1 Parent(s): 7357cfb

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +11 -0
app.js CHANGED
@@ -15,6 +15,8 @@ const CRON_SECRET = process.env.CRON_SECRET || "default_secret";
15
  const SMART_MODEL_ID = "claude";
16
  const FAST_MODEL_ID = "gpt-5-mini";
17
 
 
 
18
  if (!SUPABASE_URL || !SUPABASE_KEY) process.exit(1);
19
 
20
  const app = express();
@@ -140,6 +142,15 @@ async function registerMorningCron(projectId, offset) {
140
  }).catch(()=>{});
141
  }
142
 
 
 
 
 
 
 
 
 
 
143
  async function executeCommands(userId, projectId, commands) {
144
  let flags = { shouldReload: false, thrustComplete: false };
145
 
 
15
  const SMART_MODEL_ID = "claude";
16
  const FAST_MODEL_ID = "gpt-5-mini";
17
 
18
+ const UTILITY_SERVER_URL = "https://lu5zfciin5mk34fowavmhz7dt40pkhhg.lambda-url.us-east-1.on.aws"
19
+
20
  if (!SUPABASE_URL || !SUPABASE_KEY) process.exit(1);
21
 
22
  const app = express();
 
142
  }).catch(()=>{});
143
  }
144
 
145
+ async function dispatchEmail(userId, projectId, projectName, briefingId, markdownContent) {
146
+ console.log(`📧 Dispatching email to Utility Server for Project: ${projectName}`);
147
+ fetch(`${UTILITY_SERVER_URL}/api/email/send-briefing`, {
148
+ method: 'POST',
149
+ headers: { 'Content-Type': 'application/json' },
150
+ body: JSON.stringify({ userId, projectId, projectName, briefingId, markdownContent })
151
+ }).catch(e => console.error("Email Dispatch Error:", e.message));
152
+ };
153
+
154
  async function executeCommands(userId, projectId, commands) {
155
  let flags = { shouldReload: false, thrustComplete: false };
156