feat: monthly email digest#10621
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@Pradumn27 is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for following the naming conventions! 🙏 |
| createdAt: { | ||
| // created before last 30days | ||
| lte: date30DaysAgo, | ||
| }, |
There was a problem hiding this comment.
We're querying all the teams which were created more than 30 days ago
| const createdAt = team.createdAt; | ||
|
|
||
| // Setting both times to midnight as we will only compare the days | ||
| date30DaysAgo.setHours(0, 0, 0, 0); | ||
| createdAt.setHours(0, 0, 0, 0); | ||
|
|
||
| // Calculate the difference in milliseconds between createdAt and date30DaysAgo | ||
| const timeDifference = date30DaysAgo.getTime() - createdAt.getTime(); | ||
|
|
||
| // Calculate the difference in days | ||
| const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); | ||
|
|
||
| // If the daysDifference is a multiple of 30 | ||
| if (daysDifference % 30 === 0) { |
There was a problem hiding this comment.
Our goal is to trigger this email every 30 days for every team, so here we're first setting the time for the createdAt date so that there are no conflicts with time and we only compare days, next we're calculating the difference between the createdAt date and the date 30 days ago if the difference is a multiple of 30 that means another month has passed for that team and thus we can trigger an email.
There was a problem hiding this comment.
can we do last day of a month instead?
There was a problem hiding this comment.
Just to understand you clearly you're suggesting that we trigger this email at the end of every month for every team and the team receives the updates for only that particular month right?
So in the case of a team created just 10 days before the end of a month will we provide them the updates or these updates would just be for teams created at least before or at the first of the month?
Can be done just need to be sure about the logical requirements.
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
@PeerRich Who should this email all be sent to? And I think with that implementation it would be enabled by default and can't be disabled, what do you think about that? |
|
any updates here @CarinaWolli @PeerRich ? |
I'll attach a few suggested changes for design with a Figma shortly. Send to all admins and Owners yes. I would say turn on by default and we can have an option to turn off. Will also share in Figma where we should put that. |
|
Thanks for the review @PeerRich , have corrected the font and also updated the configuration such that now the email will be triggered on the last day of every month and every team created on or before the first of this month will get the monthly digest. Here's a screenshot with the corrected font.
|
|
any updates here @PeerRich @CarinaWolli |
|
Thanks for the review @CarinaWolli have fixed the font, and now it's cal sans everywhere, here's how it looks in the mail
|
|
@Pradumn27 Can you also make sure everything looks as in the Figma design? Some issue I see is bold fonts where it shouldn't and the line should be gray |
|
Resolved @CarinaWolli
|
CarinaWolli
left a comment
There was a problem hiding this comment.
Everything looks good now! Thank you for responding that quickly to my feedback 🙏
There was a problem hiding this comment.
Just a side note here @Pradumn27 @CarinaWolli we shouldn't allow nameless migrations for the next time 🙏🏽
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Peer Richelsen <peer@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Peer Richelsen <peer@cal.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>






What does this PR do?
Fixes #10026
/claim #10026
Screen.Recording.2023-08-06.at.10.06.12.PM.mov
Technical Details
Type of change
How should this be tested?
Mandatory Tasks