Create Broadcast - Resend
Documentation page from Resend
Skip to main content[Resend home page, "Create a draft broadcast" section
Context:
// Create a draft broadcast
const { data, error } = await resend.broadcasts.create({...});
// Create and send immediately
const { data, error } = await resend.broadcasts.create({...});
// Create and schedule
const { data, error } = await resend.broadcasts.create({...});
Issue: >>>const { data, error }<<< is declared three times in the same code block using const
Problem: In JavaScript, const declarations cannot be redeclared in the same scope. Declaring const { data, error } three times in the same block will throw a SyntaxError: Identifier 'data' has already been declared at runtime.
Fix: Use unique variable names for each declaration, for example:
const { data: draftData, error: draftError } = await resend.broadcasts.create({...});
const { data: sendData, error: sendError } = await resend.broadcasts.create({...});
const { data: scheduleData, error: scheduleError } = await resend.broadcasts.create({...});
Or use let with separate variable names, or wrap each example in its own block scope with {}.
No product messaging analysis available for this page.
No competitive analysis available for this page.