* early UI refresher of workflows using v3 designs. needs tons of testing, might have broken
* Delete .claude/settings.local.json
* fix: bunch of design fixes, merge conflict fixes
* fix: e2e and type-check
* fix: await button click
* review fixes
* code rabbit fixes
* fix styles in variables dropdown
* fix text truncate
* fix: unit tests
* fix: unit tests
* chore: add missing i18n
* review fixes
* review fixes
* fix testing info message
* move timeSectionText up
* fix which team does this apply to info message
* disable set up agent button with read only
* fix: cal.ai breaking on mobile screen
---------
Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit222001@gmail.com>
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* feat: add cancelledBy and rescheduledBy parameters to workflow links
- Extended workflow reminder selection to include user and team data
- Added getWorkflowAssigneeEmail helper function to resolve assignee email
- Updated email and SMS workflow templates to include assignee in cancel/reschedule links
- For user workflows, uses user email; for team workflows, uses team owner email
- Maintains backward compatibility when assignee data is unavailable
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* fix: use workflow recipient email instead of assignee email for link parameters
- Updated getWorkflowRecipientEmail to determine recipient based on workflow action type
- EMAIL_ADDRESS uses sendTo email, EMAIL_HOST uses organizer, EMAIL_ATTENDEE uses attendee
- SMS_ATTENDEE/WHATSAPP_ATTENDEE use attendee email for cancelledBy/rescheduledBy params
- Maintains backward compatibility when recipient data unavailable
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* fix: use emailReminderManager for email workflows with recipient parameters
- Updated emailReminderManager to include recipient email in cancel/reschedule links
- Added getEmailWorkflowRecipientEmail function for proper recipient determination
- Removed changes from deprecated scheduleEmailReminders.ts
- SMS_ATTENDEE correctly uses attendee email like EMAIL_ATTENDEE
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Get attendee's email when sending SMS
* Remove unused query
* feat: add cancelledBy and rescheduledBy parameters to getSMSMessageWithVariables
Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com>
* Clean up Devin
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* Add credits section to billing
* create seperate router for credits
* add stripe checkout session
* schema changes + code improvements
* rename to creditBalance
* custom quantify input with error message
* add checkout session completed webhook endpoint
* fix typo
* UI fixes
* add payCredits handler
* add error toast message
* allow scheduling sms up as close to 15 minutes in the future
* schedule at most 2 hours in advance
* webhook to pay for sent sms
* continued work on twilio callback
* code clean up
* further implementation for credit handling
* add migration
* object as param for scheduleSMS
* object as param for sendSMS
* fix TrpcSessionUser imports
* fix imports
* add db changes
* add cron job for price setting
* twilio status callback to create expense log
* remove unused code
* set up low credit balance email
* fixes for buying credits
* fixes in api/twilio/webhook
* add test to save credits to credits balance
* fix typos
* add new helper function chargeCredits
* expand twilioProvider
* fix type errors
* adjust tests
* type errors
* clean up
* clean up
* fix subscription active check
* remove some user/org related code
* more changes to remove user/org support
* send emails seperatly to admins
* fixes for team billing page
* fix stripe success url
* fixes to creating expense log
* email imrovements and more
* get monthly team price from stripe
* fix import
* fix monthly credits calculation
* finsih low credit balance warning email
* credit balance limit reached email
* create CreditService
* cancel SMS and send as email instead
* add messageDispatcher
* fix type error
* fix type error
* fix type error
* fix import
* fix unit test
* clean up twilioProvider
* clean up chckSmsPrices/route
* add missing translations
* add skeleton loader
* add admin check to get handler
* code clean up + fixes
* improve scheduling with fallback
* fix type error
* add bookingUid to handleSendingSMS
* add unit tests for creditService
* add more tests to credit-service.test.ts
* add test for cancelScheduledMessagesAndScheduleEmails
* fix test and type error
* add back resolve
* fix empty resolve
* adjust limitReachedAt logic
* address mrge comment on styling
* add getAdminMembership to repository
* twilio/webhook clean up (feedback)
* feedback - clean up
* remove todo comment
* clean up twilio/webhook
* code clean up
* add use client
* add createOneTimeCheckout to stripe service
* refactor repository pattern
* small fixes + clean up
* fix type error
* add missing import
* fix hasAvailableCredits for user
* force-dynamic
* rename credits to creditBalance
* fix stripe import
* remove not needed code
* fix e2e tests
* improve low balance warning email
* dynamic-import CreditService
* index.ts
* fix e2e tests
* remove dynamic import CreditService
* Revert "remove dynamic import CreditService"
This reverts commit e272978a7ff3fc5a04139e656c9f8d2c84a40dda.
* no need to dynamic-import credit service
* Revert "no need to dynamic-import credit service"
This reverts commit ba5ae488d08979a65fb47b5d0722cda9f45d6ea0.
* only select id in getAdminMembership
* revert billing/package.json
* fix type checks
* fix type checks
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: hbjORbj <sldisek783@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* Do not call dub if API key isn't present
* Add `WorkflowOptOutContact` table
* Add `sendTo` column to `WorkflowReminder`
* Add `workflowOptOutContactRepository`
* Add `WorkflowReminderRepository`
* Write `sendTo` number when scheduling SMS messages
* Add `p-limit` package
* Add `determineOptOutType` to `TwilioProvider`
* Add `deleteMultipleScheduledSMS`
* Create `WorkflowOptOutService`
* Add endpoint handler for Twilio SMS responses
* Add `isOptedOut` method to `workflowOptOutContactRepository`
* Verify phone number is not opted out before scheduling SMS
* Use `smsReminderNumber` instead of `sendTo`
* Type fix
* Add .env variable if opt out is available
* Add opt out message to SMS
* Import `pLimit` directly in method
* Address select comment
* Guard against undefined phone number from form
* Add early return to `deleteWorkflowReminders`
* Add request validation from Twilio
* Add fallback message as i18N string
* Only delete SMS attendee scheduled reminders
* Add translations in respective files
* implement multilingual support for email templates
* fix: indentation in common.js & typos in common.js and update.handler.ts
* Add akismet package to tasker
* Create scanWorkflowBody task
* Schedule workflow body scan
* Add AKISMET_API_KEY .env
* Auto lock user if spam is detected
* Uncommit key
* Add safe param to workflow step
* Migration for safe field
* Do not process workflow steps is `safe` is false
* Update migration to set previous records to true
* Address comments
* Refactor `scheduleWorkflowNotifications` to accept an object
* If new steps or editing old ones send to tasker
* Call `scheduleWorkflowNotifications` in task
* Fix `IS_SELF_HOSTED`
* Remove unused function
* Make `safe` optional in schema
* Type fix
* Revert "Make `safe` optional in schema"
This reverts commit d0964702affa87c35562300301473d25635c565b.
* Revert "Type fix"
This reverts commit d9a031303269a2994ae46f576ab2a3d31e4d977b.
* Type fixes
* Type fixes
* Address comments
* Fix tests
* Add tests
* Update tests
* Typo fix
* Update `safe` to `verifiedAt`
* feat: Compare workflow reminder bodies to default template (#19060)
* Add `getTemplateForAction` function
* Use `getTemplateForAction` when creating a new step
* Use `getTemplateForAction` when action changes
* Have `emailReminderTemplate` accept an object as a param
* Rename `getTemplateForAction` to `getTemplateBodyForAction`
* Simplify changing body when changing templates
* Create `compareReminderBodyToTemplate`
* In task, compare if reminderBody is a template
* Linting
* Add tests
* refactor: `emailReminderTemplate` to accept object as param (#19288)
* Add `getTemplateForAction` function
* Use `getTemplateForAction` when creating a new step
* Use `getTemplateForAction` when action changes
* Have `emailReminderTemplate` accept an object as a param
* Rename `getTemplateForAction` to `getTemplateBodyForAction`
* Simplify changing body when changing templates
* Create `compareReminderBodyToTemplate`
* In task, compare if reminderBody is a template
* Linting
* Add tests
* Refactor `scheduleEmailReminders`
* Refactor `create.handler` for new workflows
* Refactor `emailReminderManager`
* Refactor `getEmailTemplateText`
* Fix typo
* Type fix - whatsapp plain text template imports
* Type fix - no template found
* Type fix - add `isBrandingDisabled` to `emailReminderTemplate`
* Add workflow and user to prisma mock
* Fix imports for akismet dependencies
* Record user lock reason
* Undo linting changes
* Fix tests
* New workflow, at verify created step
* Handle if `SCANNING_WORKFLOW_STEPS` is toggled
* Move `verifiedAt` checks to specific schedule functions
- `scheduleWhatsappReminder`
- `scheduleEmailReminder`
- `scheduleSMSReminder`
* Update logic
* Do not fallback verifiedAt
* Add comment to next.config.js
* feat: add getshortenLinks function
* feat: use shortenLinks in SMS Worflows
* chore: use getShortenLink and cleanup getShortenLinks
* fix: Duplicate keys error
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Remove title and subtitle from ICS calendar description
* Remove unused method
* Use generateIcsString function for workflows
* Type fixes
* Refactor typing of CalEventParser
* WIP
* Type fixes
* Fix test
* Fix tests
* type fixes
* Remove duplicate code before `scheduleEmailReminder`
* fix: Workflow action 'email to host' only sends to one host of team event
* add in missing files
* fix host logic
* uncomment working test
* code refactor
* use connected calendar email
* add changes to util file
* fix: extend eventType info in sendCancelledReminders
---------
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* feat: Workflow — Send Email to Specific Email
* disable button when verifyEmail pending
* add verified emails table and routes
* fix: include teamId in verifyEmailCode
* fix: include email address in activate handler
* fix: check team before adding email
* feat: check verified email, add to team if only users
* remove logs
* fix: if statement
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
* change email to verify your email
* fix: show error if saving unverified email
* fix: show email in subject
* verify email when editing steps
* remove double calls from same block
* verify email when creating new step
---------
Co-authored-by: v0ltZzie <161201747+v0ltZzie@users.noreply.github.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
* remove event type requires confirmation
* allow sms sending also for team (frontend)
* allow text to attendee for team (backend)
* add rate limiting for SMS (WIP)
* add functionality to lock and unlock SMS sending (+admin UI view)
* rename to smsLockState
* add ability to lock users and teams
* don't send sms if locked
* add missing imports
* fix rate limit namespace
* add translation
* fix type error
* remove prop from UsersTable
* add smsLockState to buildUser
* code clean up
* create seperate sms rate limit function
* fix type error
* add missing userId and teamId to sendSMS
* code improvements
* add User Team type
* fix marking as reviewed
* check monthly sms limit only for user
* don't lock orgs
* fix type error
* fix avatars
* fix type error
* fix type error
* fix type error
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* add reschedule link if event if type team
* fix type errors
* fix type errors
* change team.name to team.slug
* fix type_errors
* fix type-errors
* fix type-errors
* fetch team from db
* make rescheduleLink dynamic (temp_changes)
* fix type-error
* add org support
* fix type errors
* remove old org code
* use /reschedule/uid instead
* remove not needed changes
* implement feedback
* code clean up
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* add workflows to bookingScenario
* activate sandbox mode for unit/integreation tests
* add sendgrid specific code to SendgridProvider
* Refactor WIP
* remove duplicate sendgridProvider file
* first implementation for testing workflows
* revert unintended changes
* comment out Workflow trigger tests
* move sendgrid check after test mode
* Update signup.tsx
* fix esLint
* test webhooks on all tests in fresh-booking.test.ts
* fix subjectPattern as title can be different
* add workflow tests to reschedule.test.ts
* code clean up
* code clean up
* fix sendgrid credentials missing message
* code clean up
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>