-
Notifications
You must be signed in to change notification settings - Fork 55
Add broadcast and audience management tools #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Everything in the previous "Unreleased" section was actually released in v1.1.0, so I merged its contents with the 1.1.0 section and added a new Unreleased section at the top for future changes.
Not crucial, since this isn't an npm package, but we may as well.
I'm planning on adding several more after this.
text: [ | ||
`ID: ${id}`, | ||
`Name: ${name}`, | ||
audience_id !== null && `Audience ID: ${audience_id}`, | ||
`Status: ${status}`, | ||
`Created at: ${created_at}`, | ||
scheduled_at !== null && `Scheduled at: ${scheduled_at}`, | ||
sent_at !== null && `Sent at: ${sent_at}`, | ||
] | ||
.filter(Boolean) | ||
.join('\n'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got grand plans to replace this with a fancy tagged template function that could be called like
text: lines`
ID: ${id}
Name: ${name}
${audience_id !== null && `Audience ID: ${audience_id}`}
Status: ${status}
Created at: ${created_at}
${scheduled_at !== null && `Scheduled at: ${scheduled_at}`}
${sent_at !== null && `Sent at: ${sent_at}`}
`,
But we'll see if I get around to it. This isn't too bad as-is, I think.
// TODO: Fix `first_name` type in SDK. It's actually returning `string | null`, not `string | undefined`. | ||
contact.first_name != null && `First name: ${contact.first_name}`, | ||
// TODO: Fix `last_name` type in SDK. It's actually returning `string | null`, not `string | undefined`. | ||
contact.last_name != null && `Last name: ${contact.last_name}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: Fix `firstName` and `lastName` types in SDK. Passing `null` to one of these is the only way to remove a contact's first or last name. | ||
firstName: firstName as string | undefined, | ||
lastName: lastName as string | undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these tools for my Resend MCP Hackathon entry. It would probably be easiest to review one commit at a time.
Note that this PR depends on #19 (and currently includes all of its commits).