diff --git a/index.ts b/index.ts index 08069e5..f7c93b1 100644 --- a/index.ts +++ b/index.ts @@ -3,14 +3,19 @@ const resend = new Resend('re_123456789'); (async function() { try { - const data = await resend.emails.send({ + const response = await resend.emails.send({ from: 'Acme ', to: ['delivered@resend.dev'], subject: 'Hello World', html: 'It works!' }); - console.log(data); + if (response.error) { + console.error(response.error) + return; + } + + console.log(response); } catch (error) { console.error(error); }