Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Add debug logs for agent sponsor email

Erik Engervall3671c48c1a26
diff --git a/apps/api/src/controllers/v2/agent-signup.ts b/apps/api/src/controllers/v2/agent-signup.ts
index aa17c8c24..43eadafb4 100644
--- a/apps/api/src/controllers/v2/agent-signup.ts
+++ b/apps/api/src/controllers/v2/agent-signup.ts
@@ -280,9 +280,13 @@ export async function agentSignupController(req: Request, res: Response) {
})}`;
if (config.RESEND_API_KEY) {
- const resend = new Resend(config.RESEND_API_KEY);
- await resend.emails
- .send({
+ logger.info("Sending agent sponsor confirmation email", {
+ to: email.toLowerCase(),
+ agent_name,
+ });
+ try {
+ const resend = new Resend(config.RESEND_API_KEY);
+ const sendResult = await resend.emails.send({
from: "Firecrawl <[email protected]>",
to: [email],
reply_to: "[email protected]",
@@ -299,12 +303,35 @@ export async function agentSignupController(req: Request, res: Response) {
<br/>
<p>Thanks,<br/>Firecrawl Team</p>
`,
- })
- .catch(err => {
- logger.error("Failed to send agent sponsor confirmation email", {
- error: err,
+ });
+ if (sendResult.data?.id) {
+ logger.info("Agent sponsor confirmation email sent", {
+ to: email.toLowerCase(),
+ resendId: sendResult.data.id,
});
+ } else {
+ logger.warn(
+ "Agent sponsor confirmation email failed or returned no id",
+ {
+ to: email.toLowerCase(),
+ error: sendResult.error,
+ },
+ );
+ }
+ } catch (err) {
+ logger.error("Failed to send agent sponsor confirmation email", {
+ to: email.toLowerCase(),
+ error: err,
+ message: err instanceof Error ? err.message : String(err),
});
+ }
+ } else {
+ logger.warn(
+ "RESEND_API_KEY not set; skipping agent sponsor confirmation email",
+ {
+ to: email.toLowerCase(),
+ },
+ );
}
// If sponsor email matches an existing user, queue in-app notification