fix: Fix for 'Scheduling by cal.com' is still showing in workflow emails even when branding is disabled #18862
+576
−6,037
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This Checks for user has disabled branding, team has disabled branding or Organization has disabled branding based on the workflows.
For the User workflows, it checks for the hideBranding key in the User Schema
For the Team workflows, it checks for the hideBranding key in the Team Schema
For checking for the Organization workflows, it check first checks whether the sub-team which created the workflow has a parent Team or not and if it is then it identifies as a Organization and automatically disables branding
This helps check for the disability of branding on all the workflows
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
To test this, Reminders can be created on the different category of workflows and then checked for the branding in the received reminders. For SMS, it is not required to check as it is in Pro Plan. This should only be tested in CustomTemplate and ReminderEmailTemplate.