2023-08-18 18:13:21 +00:00
|
|
|
// eslint-disable-next-line no-restricted-imports
|
2023-03-14 04:19:05 +00:00
|
|
|
import { cloneDeep } from "lodash";
|
2023-02-27 20:45:40 +00:00
|
|
|
import type { TFunction } from "next-i18next";
|
2022-12-07 21:47:02 +00:00
|
|
|
|
2023-03-10 14:38:29 +00:00
|
|
|
import type { EventNameObjectType } from "@calcom/core/event";
|
|
|
|
import { getEventName } from "@calcom/core/event";
|
2023-02-27 20:45:40 +00:00
|
|
|
import type BaseEmail from "@calcom/emails/templates/_base-email";
|
2022-06-10 00:32:34 +00:00
|
|
|
import type { CalendarEvent, Person } from "@calcom/types/Calendar";
|
2022-03-23 22:00:30 +00:00
|
|
|
|
2023-09-19 14:19:36 +00:00
|
|
|
import type { MonthlyDigestEmailData } from "./src/templates/MonthlyDigestEmail";
|
2023-06-07 07:27:48 +00:00
|
|
|
import type { EmailVerifyLink } from "./templates/account-verify-email";
|
|
|
|
import AccountVerifyEmail from "./templates/account-verify-email";
|
2023-08-23 21:01:12 +00:00
|
|
|
import type { OrganizationNotification } from "./templates/admin-organization-notification";
|
|
|
|
import AdminOrganizationNotification from "./templates/admin-organization-notification";
|
2022-06-06 17:49:56 +00:00
|
|
|
import AttendeeAwaitingPaymentEmail from "./templates/attendee-awaiting-payment-email";
|
|
|
|
import AttendeeCancelledEmail from "./templates/attendee-cancelled-email";
|
2023-03-14 04:19:05 +00:00
|
|
|
import AttendeeCancelledSeatEmail from "./templates/attendee-cancelled-seat-email";
|
2023-04-13 19:07:10 +00:00
|
|
|
import AttendeeDailyVideoDownloadRecordingEmail from "./templates/attendee-daily-video-download-recording-email";
|
2022-06-06 17:49:56 +00:00
|
|
|
import AttendeeDeclinedEmail from "./templates/attendee-declined-email";
|
|
|
|
import AttendeeLocationChangeEmail from "./templates/attendee-location-change-email";
|
|
|
|
import AttendeeRequestEmail from "./templates/attendee-request-email";
|
|
|
|
import AttendeeRescheduledEmail from "./templates/attendee-rescheduled-email";
|
|
|
|
import AttendeeScheduledEmail from "./templates/attendee-scheduled-email";
|
2023-08-01 14:13:28 +00:00
|
|
|
import type { EmailVerifyCode } from "./templates/attendee-verify-email";
|
|
|
|
import AttendeeVerifyEmail from "./templates/attendee-verify-email";
|
2022-09-15 01:27:46 +00:00
|
|
|
import AttendeeWasRequestedToRescheduleEmail from "./templates/attendee-was-requested-to-reschedule-email";
|
2022-06-25 05:16:20 +00:00
|
|
|
import BrokenIntegrationEmail from "./templates/broken-integration-email";
|
2022-12-07 21:47:02 +00:00
|
|
|
import DisabledAppEmail from "./templates/disabled-app-email";
|
2023-02-27 20:45:40 +00:00
|
|
|
import type { Feedback } from "./templates/feedback-email";
|
|
|
|
import FeedbackEmail from "./templates/feedback-email";
|
|
|
|
import type { PasswordReset } from "./templates/forgot-password-email";
|
|
|
|
import ForgotPasswordEmail from "./templates/forgot-password-email";
|
2023-09-19 14:19:36 +00:00
|
|
|
import MonthlyDigestEmail from "./templates/monthly-digest-email";
|
2023-04-11 21:44:14 +00:00
|
|
|
import NoShowFeeChargedEmail from "./templates/no-show-fee-charged-email";
|
feat: org invite billing (#9291)
* Initial commit
* Adding feature flag
* Desktop first banner, mobile pending
* Removing dead code and img
* AppInstallButtonBase
* WIP
* Adds Email verification template+translations for organizations (#9202)
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Session logic to show org label
* Step 2 done, avatar not working
* List orgs and list teams specific if orgs exist
* Conditionally show org - fix settings layout - add labels for all pages
* Profile Page + update
* Org specific team creation
* appearance page
* Ensure members cant of org cant update settings in UI
* Fix update handler imports
* hide billing on sub teams
* Update profile slug page
* Letting duplicate slugs for teams to support orgs
* Add slug coliisions for org
* Covering null on unique clauses
* Covering null on unique clauses
* Extract to utils
* Update settings to use subdomain path in team url , team + org
* Supporting having the orgId in the session cookie
* Onboarding admins step
* Last step to create teams
* Update handler comments
* Upgrade ORG banner - disabled team banner for child teams
* Handle publishing ORGS
* Fix licenese issue
* Update packages/trpc/server/routers/viewer/teams/create.handler.ts
* Split into function calls to make this file more explisit
* Update parents stripe sub not teamID
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Create org membership also - billing portal page
* A11ly
* Hide create team if no valid permisisons
* Get Org members router
* Handle updating subscription if orgId
* Fix double upgrade banner
* Update constants
* Feedback
* Copy change
* Making an org avatar (temp)
* Add slug colission detection for user and team name
* Fix Import
* Remove update password func
* Fix module import over relative
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Fix import again
* Throw no team found before auth error
* Check if invited found user is already in differnt org
* Move to for of loop to throw errors in usenamelist
* Remove app install button sa its in 9337
* Remove i18n key not being used
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Fix router
* feat: organization settings general and members page (#9266)
* feat: organization settings general page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* feat: add members page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore: remove
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use invalidate
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: delete mutation
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: remove organization id
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use zod schema
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Type fixes
* Use org Stripe product when upgrading
* Removed unused code
* Reverting changes
* Update UsernameTextfield.tsx
* More reverts
* Update next-auth-options.ts
* Update common.json
* Type fixes
* Include invite token for orgs
* Update org schema
* Make token settings optional as it isnt used in orgs yet
* Reverts
* remove yarn.lock from commit
* Fix types
* feat: orgs unverified (#9415)
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* Fix wrong banner being displayed
* Type fix
* Fix type issues
* Update packages/trpc/server/routers/viewer/teams/inviteMember.handler.ts
Co-authored-by: alannnc <alannnc@gmail.com>
* fix missing input on trpc query
* Fix for parentId value for createProvisionalMembership
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: alannnc <alannnc@gmail.com>
2023-07-02 18:40:12 +00:00
|
|
|
import type { OrgAutoInvite } from "./templates/org-auto-join-invite";
|
|
|
|
import OrgAutoJoinEmail from "./templates/org-auto-join-invite";
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
import type { OrganizationEmailVerify } from "./templates/organization-email-verification";
|
|
|
|
import OrganizationEmailVerification from "./templates/organization-email-verification";
|
2023-03-14 04:19:05 +00:00
|
|
|
import OrganizerAttendeeCancelledSeatEmail from "./templates/organizer-attendee-cancelled-seat-email";
|
2022-06-06 17:49:56 +00:00
|
|
|
import OrganizerCancelledEmail from "./templates/organizer-cancelled-email";
|
2023-07-11 20:26:30 +00:00
|
|
|
import OrganizerDailyVideoDownloadRecordingEmail from "./templates/organizer-daily-video-download-recording-email";
|
2022-06-06 17:49:56 +00:00
|
|
|
import OrganizerLocationChangeEmail from "./templates/organizer-location-change-email";
|
|
|
|
import OrganizerPaymentRefundFailedEmail from "./templates/organizer-payment-refund-failed-email";
|
|
|
|
import OrganizerRequestEmail from "./templates/organizer-request-email";
|
|
|
|
import OrganizerRequestReminderEmail from "./templates/organizer-request-reminder-email";
|
2022-09-15 01:27:46 +00:00
|
|
|
import OrganizerRequestedToRescheduleEmail from "./templates/organizer-requested-to-reschedule-email";
|
2022-06-06 17:49:56 +00:00
|
|
|
import OrganizerRescheduledEmail from "./templates/organizer-rescheduled-email";
|
|
|
|
import OrganizerScheduledEmail from "./templates/organizer-scheduled-email";
|
2023-04-13 02:10:23 +00:00
|
|
|
import SlugReplacementEmail from "./templates/slug-replacement-email";
|
2023-02-27 20:45:40 +00:00
|
|
|
import type { TeamInvite } from "./templates/team-invite-email";
|
|
|
|
import TeamInviteEmail from "./templates/team-invite-email";
|
|
|
|
|
|
|
|
const sendEmail = (prepare: () => BaseEmail) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
try {
|
|
|
|
const email = prepare();
|
|
|
|
resolve(email.sendEmail());
|
|
|
|
} catch (e) {
|
|
|
|
reject(console.error(`${prepare.constructor.name}.sendEmail failed`, e));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2021-11-26 11:03:43 +00:00
|
|
|
|
2023-05-09 17:08:14 +00:00
|
|
|
export const sendScheduledEmails = async (
|
|
|
|
calEvent: CalendarEvent,
|
|
|
|
eventNameObject?: EventNameObjectType,
|
|
|
|
hostEmailDisabled?: boolean,
|
|
|
|
attendeeEmailDisabled?: boolean
|
|
|
|
) => {
|
2022-02-10 17:42:06 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
2021-11-26 11:03:43 +00:00
|
|
|
|
2023-05-09 17:08:14 +00:00
|
|
|
if (!hostEmailDisabled) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent })));
|
2023-02-27 20:45:40 +00:00
|
|
|
|
2023-05-09 17:08:14 +00:00
|
|
|
if (calEvent.team) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent, teamMember })));
|
|
|
|
}
|
2023-02-27 20:45:40 +00:00
|
|
|
}
|
|
|
|
}
|
2021-11-26 11:03:43 +00:00
|
|
|
|
2023-05-09 17:08:14 +00:00
|
|
|
if (!attendeeEmailDisabled) {
|
|
|
|
emailsToSend.push(
|
|
|
|
...calEvent.attendees.map((attendee) => {
|
|
|
|
return sendEmail(
|
|
|
|
() =>
|
|
|
|
new AttendeeScheduledEmail(
|
|
|
|
{
|
|
|
|
...calEvent,
|
|
|
|
...(eventNameObject && {
|
|
|
|
title: getEventName({ ...eventNameObject, t: attendee.language.translate }),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
attendee
|
|
|
|
)
|
|
|
|
);
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2021-11-26 11:03:43 +00:00
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendRescheduledEmails = async (calEvent: CalendarEvent) => {
|
2022-02-10 17:42:06 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
2023-02-27 20:45:40 +00:00
|
|
|
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRescheduledEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRescheduledEmail({ calEvent, teamMember })));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-26 11:03:43 +00:00
|
|
|
emailsToSend.push(
|
2022-02-10 17:42:06 +00:00
|
|
|
...calEvent.attendees.map((attendee) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
return sendEmail(() => new AttendeeRescheduledEmail(calEvent, attendee));
|
2021-11-26 11:03:43 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2023-03-14 04:19:05 +00:00
|
|
|
export const sendRescheduledSeatEmail = async (calEvent: CalendarEvent, attendee: Person) => {
|
|
|
|
const clonedCalEvent = cloneDeep(calEvent);
|
|
|
|
const emailsToSend: Promise<unknown>[] = [
|
|
|
|
sendEmail(() => new AttendeeRescheduledEmail(clonedCalEvent, attendee)),
|
|
|
|
sendEmail(() => new OrganizerRescheduledEmail({ calEvent })),
|
|
|
|
];
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2022-07-01 19:19:23 +00:00
|
|
|
export const sendScheduledSeatsEmails = async (
|
|
|
|
calEvent: CalendarEvent,
|
|
|
|
invitee: Person,
|
2022-10-18 19:41:50 +00:00
|
|
|
newSeat: boolean,
|
2023-10-12 14:57:35 +00:00
|
|
|
showAttendees: boolean,
|
|
|
|
hostEmailDisabled?: boolean,
|
|
|
|
attendeeEmailDisabled?: boolean
|
2022-07-01 19:19:23 +00:00
|
|
|
) => {
|
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
2023-10-12 14:57:35 +00:00
|
|
|
if (!hostEmailDisabled) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent, newSeat })));
|
2022-07-01 19:19:23 +00:00
|
|
|
|
2023-10-12 14:57:35 +00:00
|
|
|
if (calEvent.team) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerScheduledEmail({ calEvent, newSeat, teamMember })));
|
|
|
|
}
|
2023-02-27 20:45:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-12 14:57:35 +00:00
|
|
|
if (!attendeeEmailDisabled) {
|
|
|
|
emailsToSend.push(sendEmail(() => new AttendeeScheduledEmail(calEvent, invitee, showAttendees)));
|
|
|
|
}
|
2022-07-01 19:19:23 +00:00
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2023-03-14 04:19:05 +00:00
|
|
|
export const sendCancelledSeatEmails = async (calEvent: CalendarEvent, cancelledAttendee: Person) => {
|
|
|
|
const clonedCalEvent = cloneDeep(calEvent);
|
|
|
|
await Promise.all([
|
|
|
|
sendEmail(() => new AttendeeCancelledSeatEmail(clonedCalEvent, cancelledAttendee)),
|
|
|
|
sendEmail(() => new OrganizerAttendeeCancelledSeatEmail({ calEvent })),
|
|
|
|
]);
|
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendOrganizerRequestEmail = async (calEvent: CalendarEvent) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRequestEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team?.members) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRequestEmail({ calEvent, teamMember })));
|
2021-11-26 11:03:43 +00:00
|
|
|
}
|
2023-02-27 20:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
2021-11-26 11:03:43 +00:00
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendAttendeeRequestEmail = async (calEvent: CalendarEvent, attendee: Person) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new AttendeeRequestEmail(calEvent, attendee));
|
2022-03-07 18:18:23 +00:00
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendDeclinedEmails = async (calEvent: CalendarEvent) => {
|
2022-02-10 17:42:06 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
2021-11-26 11:03:43 +00:00
|
|
|
|
|
|
|
emailsToSend.push(
|
2022-02-10 17:42:06 +00:00
|
|
|
...calEvent.attendees.map((attendee) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
return sendEmail(() => new AttendeeDeclinedEmail(calEvent, attendee));
|
2021-11-26 11:03:43 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2023-06-07 21:54:00 +00:00
|
|
|
export const sendCancelledEmails = async (
|
|
|
|
calEvent: CalendarEvent,
|
|
|
|
eventNameObject: Pick<EventNameObjectType, "eventName">
|
|
|
|
) => {
|
2022-02-10 17:42:06 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
2021-11-26 11:03:43 +00:00
|
|
|
|
2023-02-27 20:45:40 +00:00
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerCancelledEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team?.members) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerCancelledEmail({ calEvent, teamMember })));
|
|
|
|
}
|
|
|
|
}
|
2021-11-26 11:03:43 +00:00
|
|
|
|
|
|
|
emailsToSend.push(
|
2023-02-27 20:45:40 +00:00
|
|
|
...calEvent.attendees.map((attendee) => {
|
2023-06-07 21:54:00 +00:00
|
|
|
return sendEmail(
|
|
|
|
() =>
|
|
|
|
new AttendeeCancelledEmail(
|
|
|
|
{
|
|
|
|
...calEvent,
|
|
|
|
title: getEventName({
|
|
|
|
...eventNameObject,
|
|
|
|
t: attendee.language.translate,
|
|
|
|
attendeeName: attendee.name,
|
|
|
|
host: calEvent.organizer.name,
|
|
|
|
eventType: calEvent.type,
|
|
|
|
...(calEvent.responses && { bookingFields: calEvent.responses }),
|
|
|
|
...(calEvent.location && { location: calEvent.location }),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
attendee
|
|
|
|
)
|
|
|
|
);
|
2021-11-26 11:03:43 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendOrganizerRequestReminderEmail = async (calEvent: CalendarEvent) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRequestReminderEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team?.members) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRequestReminderEmail({ calEvent, teamMember })));
|
2021-11-26 11:03:43 +00:00
|
|
|
}
|
2023-02-27 20:45:40 +00:00
|
|
|
}
|
2021-11-26 11:03:43 +00:00
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendAwaitingPaymentEmail = async (calEvent: CalendarEvent) => {
|
2022-02-10 17:42:06 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
2021-11-26 11:03:43 +00:00
|
|
|
|
|
|
|
emailsToSend.push(
|
2022-02-10 17:42:06 +00:00
|
|
|
...calEvent.attendees.map((attendee) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
return sendEmail(() => new AttendeeAwaitingPaymentEmail(calEvent, attendee));
|
2021-11-26 11:03:43 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendOrganizerPaymentRefundFailedEmail = async (calEvent: CalendarEvent) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerPaymentRefundFailedEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team?.members) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerPaymentRefundFailedEmail({ calEvent, teamMember })));
|
2021-11-26 11:03:43 +00:00
|
|
|
}
|
2023-02-27 20:45:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
2021-11-26 11:03:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const sendPasswordResetEmail = async (passwordResetEvent: PasswordReset) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new ForgotPasswordEmail(passwordResetEvent));
|
2021-11-26 11:03:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const sendTeamInviteEmail = async (teamInviteEvent: TeamInvite) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new TeamInviteEmail(teamInviteEvent));
|
2021-11-26 11:03:43 +00:00
|
|
|
};
|
2022-04-14 21:25:24 +00:00
|
|
|
|
feat: org invite billing (#9291)
* Initial commit
* Adding feature flag
* Desktop first banner, mobile pending
* Removing dead code and img
* AppInstallButtonBase
* WIP
* Adds Email verification template+translations for organizations (#9202)
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Session logic to show org label
* Step 2 done, avatar not working
* List orgs and list teams specific if orgs exist
* Conditionally show org - fix settings layout - add labels for all pages
* Profile Page + update
* Org specific team creation
* appearance page
* Ensure members cant of org cant update settings in UI
* Fix update handler imports
* hide billing on sub teams
* Update profile slug page
* Letting duplicate slugs for teams to support orgs
* Add slug coliisions for org
* Covering null on unique clauses
* Covering null on unique clauses
* Extract to utils
* Update settings to use subdomain path in team url , team + org
* Supporting having the orgId in the session cookie
* Onboarding admins step
* Last step to create teams
* Update handler comments
* Upgrade ORG banner - disabled team banner for child teams
* Handle publishing ORGS
* Fix licenese issue
* Update packages/trpc/server/routers/viewer/teams/create.handler.ts
* Split into function calls to make this file more explisit
* Update parents stripe sub not teamID
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Create org membership also - billing portal page
* A11ly
* Hide create team if no valid permisisons
* Get Org members router
* Handle updating subscription if orgId
* Fix double upgrade banner
* Update constants
* Feedback
* Copy change
* Making an org avatar (temp)
* Add slug colission detection for user and team name
* Fix Import
* Remove update password func
* Fix module import over relative
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Fix import again
* Throw no team found before auth error
* Check if invited found user is already in differnt org
* Move to for of loop to throw errors in usenamelist
* Remove app install button sa its in 9337
* Remove i18n key not being used
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Fix router
* feat: organization settings general and members page (#9266)
* feat: organization settings general page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* feat: add members page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore: remove
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use invalidate
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: delete mutation
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: remove organization id
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use zod schema
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Type fixes
* Use org Stripe product when upgrading
* Removed unused code
* Reverting changes
* Update UsernameTextfield.tsx
* More reverts
* Update next-auth-options.ts
* Update common.json
* Type fixes
* Include invite token for orgs
* Update org schema
* Make token settings optional as it isnt used in orgs yet
* Reverts
* remove yarn.lock from commit
* Fix types
* feat: orgs unverified (#9415)
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* Fix wrong banner being displayed
* Type fix
* Fix type issues
* Update packages/trpc/server/routers/viewer/teams/inviteMember.handler.ts
Co-authored-by: alannnc <alannnc@gmail.com>
* fix missing input on trpc query
* Fix for parentId value for createProvisionalMembership
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: alannnc <alannnc@gmail.com>
2023-07-02 18:40:12 +00:00
|
|
|
export const sendOrganizationAutoJoinEmail = async (orgInviteEvent: OrgAutoInvite) => {
|
|
|
|
await sendEmail(() => new OrgAutoJoinEmail(orgInviteEvent));
|
|
|
|
};
|
|
|
|
|
2023-06-07 07:27:48 +00:00
|
|
|
export const sendEmailVerificationLink = async (verificationInput: EmailVerifyLink) => {
|
|
|
|
await sendEmail(() => new AccountVerifyEmail(verificationInput));
|
|
|
|
};
|
|
|
|
|
2023-07-31 17:51:11 +00:00
|
|
|
export const sendEmailVerificationCode = async (verificationInput: EmailVerifyCode) => {
|
|
|
|
await sendEmail(() => new AttendeeVerifyEmail(verificationInput));
|
|
|
|
};
|
|
|
|
|
2022-04-14 21:25:24 +00:00
|
|
|
export const sendRequestRescheduleEmail = async (
|
|
|
|
calEvent: CalendarEvent,
|
2022-06-10 00:32:34 +00:00
|
|
|
metadata: { rescheduleLink: string }
|
2022-04-14 21:25:24 +00:00
|
|
|
) => {
|
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
2023-02-27 20:45:40 +00:00
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerRequestedToRescheduleEmail(calEvent, metadata)));
|
2022-04-14 21:25:24 +00:00
|
|
|
|
2023-02-27 20:45:40 +00:00
|
|
|
emailsToSend.push(sendEmail(() => new AttendeeWasRequestedToRescheduleEmail(calEvent, metadata)));
|
2022-04-14 21:25:24 +00:00
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
2022-05-24 13:29:39 +00:00
|
|
|
|
2022-06-10 00:32:34 +00:00
|
|
|
export const sendLocationChangeEmails = async (calEvent: CalendarEvent) => {
|
2022-05-27 23:27:41 +00:00
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
2023-02-27 20:45:40 +00:00
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerLocationChangeEmail({ calEvent })));
|
|
|
|
|
|
|
|
if (calEvent.team?.members) {
|
|
|
|
for (const teamMember of calEvent.team.members) {
|
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerLocationChangeEmail({ calEvent, teamMember })));
|
|
|
|
}
|
|
|
|
}
|
2022-05-27 23:27:41 +00:00
|
|
|
|
|
|
|
emailsToSend.push(
|
2023-02-27 20:45:40 +00:00
|
|
|
...calEvent.attendees.map((attendee) => {
|
|
|
|
return sendEmail(() => new AttendeeLocationChangeEmail(calEvent, attendee));
|
2022-05-27 23:27:41 +00:00
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
2022-05-24 13:29:39 +00:00
|
|
|
export const sendFeedbackEmail = async (feedback: Feedback) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new FeedbackEmail(feedback));
|
2022-05-24 13:29:39 +00:00
|
|
|
};
|
2022-06-25 05:16:20 +00:00
|
|
|
|
|
|
|
export const sendBrokenIntegrationEmail = async (evt: CalendarEvent, type: "video" | "calendar") => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new BrokenIntegrationEmail(evt, type));
|
2022-06-25 05:16:20 +00:00
|
|
|
};
|
2022-12-07 21:47:02 +00:00
|
|
|
|
|
|
|
export const sendDisabledAppEmail = async ({
|
|
|
|
email,
|
|
|
|
appName,
|
|
|
|
appType,
|
|
|
|
t,
|
|
|
|
title = undefined,
|
|
|
|
eventTypeId = undefined,
|
|
|
|
}: {
|
|
|
|
email: string;
|
|
|
|
appName: string;
|
|
|
|
appType: string[];
|
|
|
|
t: TFunction;
|
|
|
|
title?: string;
|
|
|
|
eventTypeId?: number;
|
|
|
|
}) => {
|
2023-02-27 20:45:40 +00:00
|
|
|
await sendEmail(() => new DisabledAppEmail(email, appName, appType, t, title, eventTypeId));
|
2022-12-07 21:47:02 +00:00
|
|
|
};
|
2023-04-11 21:44:14 +00:00
|
|
|
|
2023-04-13 02:10:23 +00:00
|
|
|
export const sendSlugReplacementEmail = async ({
|
|
|
|
email,
|
|
|
|
name,
|
|
|
|
teamName,
|
|
|
|
t,
|
|
|
|
slug,
|
|
|
|
}: {
|
|
|
|
email: string;
|
|
|
|
name: string;
|
|
|
|
teamName: string | null;
|
|
|
|
t: TFunction;
|
|
|
|
slug: string;
|
|
|
|
}) => {
|
|
|
|
await sendEmail(() => new SlugReplacementEmail(email, name, teamName, slug, t));
|
|
|
|
};
|
|
|
|
|
2023-04-11 21:44:14 +00:00
|
|
|
export const sendNoShowFeeChargedEmail = async (attendee: Person, evt: CalendarEvent) => {
|
|
|
|
await sendEmail(() => new NoShowFeeChargedEmail(evt, attendee));
|
|
|
|
};
|
2023-04-13 19:07:10 +00:00
|
|
|
|
|
|
|
export const sendDailyVideoRecordingEmails = async (calEvent: CalendarEvent, downloadLink: string) => {
|
|
|
|
const emailsToSend: Promise<unknown>[] = [];
|
|
|
|
|
2023-07-11 20:26:30 +00:00
|
|
|
emailsToSend.push(sendEmail(() => new OrganizerDailyVideoDownloadRecordingEmail(calEvent, downloadLink)));
|
|
|
|
|
2023-04-13 19:07:10 +00:00
|
|
|
for (const attendee of calEvent.attendees) {
|
|
|
|
emailsToSend.push(
|
|
|
|
sendEmail(() => new AttendeeDailyVideoDownloadRecordingEmail(calEvent, attendee, downloadLink))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
await Promise.all(emailsToSend);
|
|
|
|
};
|
feat: Organizations (#8993)
* Initial commit
* Adding feature flag
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* Letting duplicate slugs for teams to support orgs
* Covering null on unique clauses
* Supporting having the orgId in the session cookie
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* Making sure we let localhost still work
* Feedback
* Type check fixes
* feat: Organization branding in side menu (#9279)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Making sure we show the set up profile on org only
* Profile username availability rely on org hook
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Update apps/web/pages/team/[slug].tsx
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: Organization support for event types page (#9449)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Org branding provider used in shell sidebar
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Using org avatar (temp)
* Not showing org logo if not set
* User onboarding with org branding (slug)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Feedback
* Org public profile
* Public profiles for team event types
* Added setup profile alert
* Using org avatar on subteams avatar
* Processing orgs and children as profile options
* Reverting change not belonging to this PR
* Making sure we show the set up profile on org only
* Removing console.log
* Comparing memberships to choose the highest one
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Type errors
* Refactor and type fixes
* Update orgDomains.ts
* Feedback
* Reverting
* NIT
* fix issue getting org slug from domain
* Improving orgDomains util
* Host comes with port
* Update useRouterQuery.ts
* Feedback
* Feedback
* Feedback
* Feedback: SSR for user event-types to have org context
* chore: Cache node_modules (#9492)
* Adding check for cache hit
* Adding a separate install step first
* Put the restore cache steps back
* Revert the uses type for restoring cache
* Added step to restore nm cache
* Removed the cache-hit check
* Comments and naming
* Removed extra install command
* Updated the name of the linting step to be more clear
* Removes the need for useEffect here
* Feedback
* Feedback
* Cookie domain needs a dot
* Type fix
* Update apps/web/public/static/locales/en/common.json
Co-authored-by: Omar López <zomars@me.com>
* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx
* Feedback
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2023-06-14 21:40:20 +00:00
|
|
|
|
|
|
|
export const sendOrganizationEmailVerification = async (sendOrgInput: OrganizationEmailVerify) => {
|
|
|
|
await sendEmail(() => new OrganizationEmailVerification(sendOrgInput));
|
|
|
|
};
|
2023-08-23 21:01:12 +00:00
|
|
|
|
2023-09-19 14:19:36 +00:00
|
|
|
export const sendMonthlyDigestEmails = async (eventData: MonthlyDigestEmailData) => {
|
|
|
|
await sendEmail(() => new MonthlyDigestEmail(eventData));
|
|
|
|
};
|
|
|
|
|
2023-08-23 21:01:12 +00:00
|
|
|
export const sendAdminOrganizationNotification = async (input: OrganizationNotification) => {
|
|
|
|
await sendEmail(() => new AdminOrganizationNotification(input));
|
|
|
|
};
|