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
fix: Workflow action 'email to host' only sends to one host of team e… #14767
base: main
Are you sure you want to change the base?
fix: Workflow action 'email to host' only sends to one host of team e… #14767
Conversation
@Amit91848 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link. |
Graphite Automations"Add community label" took an action on this PR • (04/26/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (04/26/24)1 reviewer was added to this PR based on Keith Williams's automation. |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
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.
packages/trpc/server/routers/viewer/workflows/update.handler.ts
Outdated
Show resolved
Hide resolved
hosts: { | ||
select: { | ||
user: { | ||
select: { |
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.
Tried using variable, typescript compiler wasn't having it so had to repeat this
) | ||
.map((host) => host.email); | ||
if ( | ||
hosts && |
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.
Initially was looping over hosts and adding fixed ones. But for Round robin with fixed users, fixed users were always made organiser so had to loop over attendees to find lucky user. To keep it same changed to always looping over attendees for hosts as this works for both Collective and Round Robin.
Lmk if you want to change that.
@@ -391,8 +391,7 @@ describe("handleNewBooking", () => { | |||
}); | |||
|
|||
expectWorkflowToBeTriggered({ | |||
// emailsToReceive: [organizer.email].concat(otherTeamMembers.map(member => member.email)), | |||
emailsToReceive: [organizer.email], | |||
emailsToReceive: [organizer.email].concat(otherTeamMembers.map((member) => member.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.
can you also add a unit test for this? and make sure to test if all the hosts receive email
Instead of writing a new test uncommented this as this tests for receiving emails for all hosts.
What does this PR do?
Fixes #14739
Don't have sendgrid so couldn't show the email, logged the info instead
Screen.Recording.2024-04-26.at.2.56.42.PM.mov
Type of change
Mandatory Tasks