Skip to content

Commit 281c02e

Browse files
committed
updated worker.js
1 parent 2825be0 commit 281c02e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/src/worker.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ async function startWorker() {
2121

2222
async function processJob(job: any) {
2323
console.log("Processing:", job);
24+
const jobs = {
25+
to: job.to
26+
}
2427
try {
2528
console.log("Sending email...");
2629

27-
await fetch((process.env.EMAIL_SENDER_URL||''), {
30+
await fetch((`${process.env.EMAIL_SENDER_URL}/send`||''), {
2831
method: 'POST',
2932
headers: {
3033
'Content-Type': 'application/json'
3134
},
32-
body: JSON.stringify(job.to)
35+
body: JSON.stringify(jobs)
3336
});
3437

3538
console.log("Email sent successfully!");

0 commit comments

Comments
 (0)