Skip to content

Nikita create weekly company summary email for admins#1291

Closed
ArtemisNyx3 wants to merge 10 commits intodevelopmentfrom
nikita-Create-Weekly-Company-Summary-Email-for-Admins
Closed

Nikita create weekly company summary email for admins#1291
ArtemisNyx3 wants to merge 10 commits intodevelopmentfrom
nikita-Create-Weekly-Company-Summary-Email-for-Admins

Conversation

@ArtemisNyx3
Copy link

@ArtemisNyx3 ArtemisNyx3 commented Mar 26, 2025

Description

image

Related PRS (if any):

To test this backend PR you need to checkout the #3316frontend PR.

Main changes explained:

  • Delete file A for removing unused components …
  • Update file B for including new pattern …
  • Create file C for introducing new components …

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. Create a google API account to test the Email Functionality and enter the following in your .env file
    Tutorial for creating the API app, you don't have watch this to the end. All neccary steps are in the first 5 mins

https://youtu.be/-rcRf7yswfM

sendEmail=true
REACT_APP_EMAIL = GOogleapi-email
REACT_APP_EMAIL_CLIENT_ID = 
REACT_APP_EMAIL_CLIENT_SECRET = 
REACT_APP_EMAIL_CLIENT_REDIRECT_URI = https://developers.google.com/oauthplayground
REACT_APP_EMAIL_REFRESH_TOKEN = 

PUPPETEER_EMAIL = adminuser-email
PUPPETEER_PASSWORD = adminuser-pwd
REACT_FRONTEND_URL = http://localhost:3000 // testing
  1. When you are getting the REFRESH TOKEN, enter CLIENT ID and CLIENT SECRET here in the redirect uri
    image

  2. Enter the recipient email of your choosing for testing in userHelper.js file
    image

  3. After following everything above, while you are running the frontend server, change the cronjob 'timing'
    image
    Comment out the everyweek setting and use the every 2 mins setting, so this way your PC wont freak out
    '*/2 * * * *'
    Also comment out everything except weekly email so it wont take ages to test it. it should look something like this
    image

Screenshots or videos of changes:

After alllll those steps you can verify if you are getting an email like this
image
The attachment looks like
image

Note:

I appreciate your patience 💖

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Mar 31, 2025
@Dharmik1710
Copy link
Contributor

I tried following the steps. GCP asks for credit card details. Instead is there any way to create a test email account and share the credentials for testing?

Copy link
Contributor

@cgomezhub cgomezhub left a comment

Choose a reason for hiding this comment

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

the function is general working but the subjt and message that is sending are diferents to the backend code
Screenshot 2025-04-05 070416
Screenshot 2025-04-05 070701
Screenshot 2025-04-05 070822
Screenshot 2025-04-05 073227

@ArtemisNyx3
Copy link
Author

ArtemisNyx3 commented Apr 6, 2025

I have followed all the steps mentioned in the PR. when sending the email, i'm getting the below error. image

Hi @manushajyasta30,
I tried to recreate the issue, but it was working for me.
And the other errors are not related to changes/additions made in this PR

@ArtemisNyx3
Copy link
Author

ArtemisNyx3 commented Apr 6, 2025

the function is general working but the subjt and message that is sending are diferents to the backend code Screenshot 2025-04-05 070416 Screenshot 2025-04-05 070701 Screenshot 2025-04-05 070822 Screenshot 2025-04-05 073227

Hi @cgomezhub
The subject for "on-demand" email and the weekly scheduled email by the cronjob are different.
You can see the "on-demand" email content and logic in reportsController.js

Please let me know if there are any more changes required

@ArtemisNyx3 ArtemisNyx3 requested a review from cgomezhub April 20, 2025 09:25
Copy link
Contributor

@naiduajaykumar naiduajaykumar left a comment

Choose a reason for hiding this comment

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

I had followed every step what I understand in the description but it doesn't work for me. When I enter the recipient email its getting failed and getting 500 Error code. Can you please include testing steps clearly. Thank you.

PR-3316+1291-2

Copy link

@Anusha-Gali Anusha-Gali left a comment

Choose a reason for hiding this comment

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

Hi Nikita,

I have reviewed your PR locally and left the comments on OneCommunityGlobal/HighestGoodNetworkApp#3316 (review)

@one-community one-community added Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. and removed High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible labels Dec 23, 2025
@DiyaWadhwani
Copy link
Contributor

Added comments on the backend PR
OneCommunityGlobal/HighestGoodNetworkApp#3316 (review)

@DiyaWadhwani
Copy link
Contributor

DiyaWadhwani commented Mar 6, 2026

Created a new PR set with updated dev code changes - #2090; #4953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants