-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat: add cancelledBy and rescheduledBy parameters to workflow links #22438
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
feat: add cancelledBy and rescheduledBy parameters to workflow links #22438
Conversation
- Extended workflow reminder selection to include user and team data - Added getWorkflowAssigneeEmail helper function to resolve assignee email - Updated email and SMS workflow templates to include assignee in cancel/reschedule links - For user workflows, uses user email; for team workflows, uses team owner email - Maintains backward compatibility when assignee data is unavailable Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ No security or compliance issues detected. Reviewed everything up to 5dbca7e. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
…parameters - Updated getWorkflowRecipientEmail to determine recipient based on workflow action type - EMAIL_ADDRESS uses sendTo email, EMAIL_HOST uses organizer, EMAIL_ATTENDEE uses attendee - SMS_ATTENDEE/WHATSAPP_ATTENDEE use attendee email for cancelledBy/rescheduledBy params - Maintains backward compatibility when recipient data unavailable Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
…meters - Updated emailReminderManager to include recipient email in cancel/reschedule links - Added getEmailWorkflowRecipientEmail function for proper recipient determination - Removed changes from deprecated scheduleEmailReminders.ts - SMS_ATTENDEE correctly uses attendee email like EMAIL_ATTENDEE Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
WalkthroughThe changes introduce a new helper function, Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/features/ee/workflows/api/scheduleEmailReminders.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. packages/features/ee/workflows/api/scheduleSMSReminders.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. packages/features/ee/workflows/lib/getWorkflowReminders.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings
🧬 Code Graph Analysis (4)packages/features/ee/workflows/api/scheduleSMSReminders.ts (1)
packages/features/ee/workflows/api/scheduleEmailReminders.ts (1)
packages/features/ee/workflows/lib/reminders/emailReminderManager.ts (1)
packages/features/ee/workflows/lib/getWorkflowReminders.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (14)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…thVariables Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
…://git-manager.devin.ai/proxy/github.com/calcom/cal.com into devin/workflow-assignee-parameters-1752272653
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/17/25)1 reviewer was added to this PR based on Keith Williams's automation. |
attendeeEmail?: string; | ||
sendToEmail?: string | null; | ||
}): string | null { | ||
// const action = reminder.workflowStep.action; |
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.
// const action = reminder.workflowStep.action; |
organizerEmail?: string; | ||
attendeeEmail?: string; | ||
sendToEmail?: string | null; |
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 think we should make the all required and explicitly accept null for props that aren't available/applicable in a particular case.
It avoids the situation when we accidentally forget to pass a prop and it was applicable.
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.
Or maybe we could have context aware wrappers that call this method. These wrapper would have fields as required. Client code won't call this method directly, it would call a wrapper of it.
e.g. getWorkflowRecipientEmailForSmsReminder would have attendeeEmail as the only field and it would be required.
attendeeEmail: reminder.booking.attendees[0].email, | ||
organizerEmail: reminder.booking.user?.email, |
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 think it is time to have a BookingFactory/BookingService to getAttendeeEmail and getOrganizerEmail.
May be in some follow-up
Didn't test(don't have enough exprience with workflows) but codewise LGTM mostly !! nothing blocking Requesting @CarinaWolli for review in terms of the logic to determine receipient is correct or not. |
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.
Looks good 👍
Adds the
cancelledBy
andrescheduledBy
params to the cancel and reschedule links that are in workflow messages.Summary by cubic
Added cancelledBy and rescheduledBy parameters to workflow cancel and reschedule links, using the assignee's email for user and team workflows.