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: meeting url variable in workflow notifitcations #12308

Merged
merged 6 commits into from
Nov 13, 2023

Conversation

CarinaWolli
Copy link
Member

@CarinaWolli CarinaWolli commented Nov 9, 2023

What does this PR do?

Fixes that the {MEETING_URL} from custom workflow templates wasn't populated for event types that require confirmation or payment.

Also fixes that confirmation emails were still sent after they were confirmed even when the default confirmation emails were disabled.

Fixes #10758

Requirement/Documentation

Have Sendgrid set up to send workflow emails.

Type of change

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

How should this be tested?

  • Create a workflow that triggers when new event is booked & sends email to attendees
  • Add a custom emails template with {MEETING_URL} variable
  • Set active on an event type that requires confrimation
  • Book event type
  • Confirm booking
  • Check if email has meeting url

Mandatory Tasks

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

Copy link

vercel bot commented Nov 9, 2023

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 5:38pm
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 5:38pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 5:38pm
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 5:38pm
cal-demo ⬜️ Ignored (Inspect) Nov 10, 2023 5:38pm
qa ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 5:38pm
ui ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 5:38pm

@github-actions github-actions bot added emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email High priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Nov 9, 2023
Copy link
Contributor

github-actions bot commented Nov 9, 2023

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

@zomars zomars added the core area: core, team members only label Nov 9, 2023
Copy link
Contributor

github-actions bot commented Nov 9, 2023

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

Copy link

deploysentinel bot commented Nov 9, 2023

No failed tests 🎉

}
}

await sendScheduledEmails(
Copy link
Member Author

Choose a reason for hiding this comment

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

Make sure confirmation emails are not sent when disabled because of an existing workflow

@@ -169,6 +213,7 @@ export async function handleConfirmation(args: {
references: {
create: scheduleResult.referencesToCreate,
},
metadata: { ...(typeof booking.metadata === "object" ? booking.metadata : {}), videoCallUrl },
Copy link
Member Author

Choose a reason for hiding this comment

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

bookings that require confirmation never had the videoCallUrl added to metadata

@@ -218,8 +263,6 @@ export async function handleConfirmation(args: {
const eventTypeSlug = updatedBookings[index].eventType?.slug || "";

const isFirstBooking = index === 0;
const videoCallUrl =
Copy link
Member Author

Choose a reason for hiding this comment

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

The original booking didn't have videoCallUrl in metadata, that's why it was missing in the workflow emails that trigger when a meeting was confirmed

@@ -2524,7 +2524,7 @@ async function handler(
...evt,
...{ metadata: metadataFromEvent, eventType: { slug: eventType.slug } },
},
isNotConfirmed: evt.requiresConfirmation || false,
isNotConfirmed: !isConfirmedByDefault,
Copy link
Member Author

Choose a reason for hiding this comment

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

also includes bookings with payments not just event types that require confirmation

Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

Looks good to me, but a add-on is needed soon to add tests to ensure emails aren't send when e.g. host confirmation emails are disabled.

@emrysal emrysal changed the title Fix: meeting url variable in workflow notifitcations fix: meeting url variable in workflow notifitcations Nov 10, 2023
@CarinaWolli CarinaWolli merged commit f29328e into main Nov 13, 2023
37 of 39 checks passed
@CarinaWolli CarinaWolli deleted the fix/meeting-url-worflow-variable branch November 13, 2023 14:28
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Nov 28, 2023
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
hbjORbj pushed a commit to codemod-com/cal.com-demo that referenced this pull request Dec 21, 2023
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
zomars pushed a commit that referenced this pull request Jan 29, 2024
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core area: core, team members only emails area: emails, cancellation email, reschedule email, inbox, spam folder, not getting email High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-2518] {MEETING_URL} intermittently missing from some custom emails
4 participants