cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

[CAL-499] Choosing the email you want to be displayed as the organizer

Open gitstart-calcom opened this issue 1 year ago • 9 comments

What does this PR do?

Fixes #5774

Demo

https://www.loom.com/share/06ee5751444c4c53a8ff43bcc2b1cd8c

image

gitstart-calcom avatar May 04 '23 14:05 gitstart-calcom

CAL-499 Choosing the email you want to be displayed as the organizer

  • I have a personal cal.com account for (eg mynamegmail.com).
  • I also want to use cal.com for my work purposes. To do that I attached my corporate Gmail calendar (eg mynamemycompany.com) to the existing personal cal.com account. As a result now I get scheduled events in the right calendar (mynamemycompany.com) but as a participant I am displayed there with my personal email (mynamegmail.com)

Desired outcome

  • Let the user choose on a per event basis which email address for them to appear as the organiser for.

  • The list of choices should be pulled from their list of connected calendars.

  • We would likely place this alongside the "Add to calendar" UI in the event type settings

linear[bot] avatar May 04 '23 14:05 linear[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:50pm
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:50pm
cal-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:50pm
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:50pm
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:50pm
web-staging 🔄 Building (Inspect) Visit Preview Mar 19, 2024 2:50pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 2:50pm
dev ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 2:50pm
qa ⬜️ Ignored (Inspect) Mar 19, 2024 2:50pm

vercel[bot] avatar May 04 '23 14:05 vercel[bot]

📦 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! 🙌

github-actions[bot] avatar May 04 '23 14:05 github-actions[bot]

Current Playwright Test Results Summary

✅ 105 Passing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 07/26/2023 02:30:37am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 8ad5d97cbd9a343499096d40afaf29a63282e9f6

Started: 07/26/2023 02:28:29am UTC

⚠️ Flakes

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Paid booking should be able to be rescheduled
Retry 1Initial Attempt
2.70% (7) 7 / 259 runs
failed over last 7 days
5.41% (14) 14 / 259 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
1.72% (3) 3 / 174 runs
failed over last 7 days
97.70% (170) 170 / 174 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar May 04 '23 14:05 deploysentinel[bot]

CALCOM-5774-mail

The selected organizer mail now shows up on the success page and in the mail. But as you can see in the above screenshot the calendar event mail is incorrect. We would like to fix that but we could not find the right component to make the changes to. If you could please direct us to the right component it would save us some time. Thank you! cc: @zomars @Jaibles

gitstart-calcom avatar May 04 '23 16:05 gitstart-calcom

If you could please direct us to the right component it would save us some time. Thank you! cc: Omar López Ciarán Hanrahan

Hey there, not sure about if this is the correct answer here but did you check on the email templates? https://github.com/calcom/cal.com/tree/main/packages/emails/templates

Also checkout CalendarManager where the primary email is passed.

https://github.com/calcom/cal.com/blob/05b42c001f997604cc55e4789ccaaf052cfca434/packages/core/CalendarManager.ts#LL84C1-L84C1

agustif avatar May 04 '23 22:05 agustif

@gitstart-calcom the video in your PR description isn't working. Can you reupload it or maybe use Loom?

joeauyeung avatar May 10 '23 23:05 joeauyeung

@gitstart-calcom the video in your PR description isn't working. Can you reupload it or maybe use Loom?

Sure, we will add a new demo video

gitstart-calcom avatar May 11 '23 06:05 gitstart-calcom

@joeauyeung The demo video has been updated now https://www.loom.com/share/06ee5751444c4c53a8ff43bcc2b1cd8c

gitstart-calcom avatar May 11 '23 09:05 gitstart-calcom

Apologies for the delay on the change request. We were trying to tackle some edge cases and got to the following conclusion:

We have tried 2 approaches trying to avoid modifying the db:

  • For the booking success page, we tried fetching the destination calendar alongside the booking data. But to retrieve the corresponding calendar email would take a lot of computation. Taking how it is done in CalendarManager.ts in getCalendarCredentials and getConnectedCalendars functions.
  • Another option was to make trpc calls within the React function to get the connected calendars and then retrieve the primary (organizer) email from it. An issue with this is that the organizer email won't show on the page load, so we would have to show a loader first (we got feedback to remove it). Another issue is that we would still make this API call in all the files where we need the correct organizer email.

So, storing the email the user wants to show in the eventType db record may be a better approach. We would like to confirm this approach before we go ahead.

gitstart-calcom avatar May 24 '23 14:05 gitstart-calcom

Apologies for the delay on the change request. We were trying to tackle some edge cases and got to the following conclusion:

We have tried 2 approaches trying to avoid modifying the db:

* For the booking success page, we tried fetching the destination calendar alongside the booking data. But to retrieve the corresponding calendar email would take a lot of computation. Taking how it is done in CalendarManager.ts in getCalendarCredentials and getConnectedCalendars functions.

* Another option was to make trpc calls within the React function to get the connected calendars and then retrieve the primary (organizer) email from it. An issue with this is that the organizer email won't show on the page load, so we would have to show a loader first (we got [feedback](https://github.com/calcom/cal.com/pull/8672#pullrequestreview-1423532947) to remove it). Another issue is that we would still make this API call in all the files where we need the correct organizer email.

So, storing the email the user wants to show in the eventType db record may be a better approach. We would like to confirm this approach before we go ahead.

Thanks for looking into it. I think we can store which email the user wants to be displayed under the event type metadata. Although if a user does not choose to change the displayed email for that event type then default to the email on their profile.

joeauyeung avatar May 30 '23 11:05 joeauyeung

Thanks for looking into it. I think we can store which email the user wants to be displayed under the event type metadata. Although if a user does not choose to change the displayed email for that event type then default to the email on their profile.

Thank you, we will make the changes and get back to you soon

gitstart-calcom avatar May 30 '23 16:05 gitstart-calcom

Hi @joeauyeung, we have updated the PR. Please take a look.

gitstart-calcom avatar Jun 08 '23 08:06 gitstart-calcom

Thank you for following the naming conventions! 🙏

github-actions[bot] avatar Jul 03 '23 06:07 github-actions[bot]

image

why do we have a skeleton here?

PeerRich avatar Jul 03 '23 06:07 PeerRich

Hi @joeauyeung, we have updated the PR. Please take a look.

@joeauyeung could you take a look at this one again?

CarinaWolli avatar Jul 06 '23 17:07 CarinaWolli

🤖 Meticulous spotted visual differences in 65 of 302 screens tested: view and approve differences detected.

Last updated for commit 8ad5d97. This comment will update as new commits are pushed.

alwaysmeticulous[bot] avatar Jul 11 '23 21:07 alwaysmeticulous[bot]

Hi @joeauyeung, we moved this PR for this other PR, please take a look, we made the requested changes 😄

gitstart-calcom avatar Jul 24 '23 21:07 gitstart-calcom

This can be closed as PR #10348 has the most recent changes

CarinaWolli avatar Aug 09 '23 23:08 CarinaWolli