Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Amit91848
Copy link
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Apr 26, 2024
@graphite-app graphite-app bot requested a review from a team April 26, 2024 09:29
Copy link

vercel bot commented Apr 26, 2024

@Amit91848 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added teams area: teams, round robin, collective, managed event-types workflows area: workflows, automations 🐛 bug Something isn't working labels Apr 26, 2024
Copy link
Contributor

github-actions bot commented Apr 26, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@dosubot dosubot bot added the emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email label Apr 26, 2024
Copy link

graphite-app bot commented Apr 26, 2024

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.

Copy link
Contributor

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@keithwillcode keithwillcode added this to the v4.1 milestone May 8, 2024
@keithwillcode keithwillcode modified the milestones: v4.1, v4.2 May 15, 2024
Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contributions.

  1. There are few more files that you have to make changes in.

Screenshot 2024-05-24 at 5 25 38 PM

  1. can you also add a unit test for this? and make sure to test if all the hosts receive email

hosts: {
select: {
user: {
select: {
Copy link
Contributor Author

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 &&
Copy link
Contributor Author

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)),
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working community Created by Linear-GitHub Sync emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email teams area: teams, round robin, collective, managed event-types workflows area: workflows, automations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3551] Workflow action 'email to host' only sends to one host of team event
3 participants