Skip to content

Sheetal phase3 Re Engagement Strategies No Show Follow Up Email#1333

Open
sheetalmangate wants to merge 30 commits intodevelopmentfrom
sheetal-phase3-backend-re-engagement-strategies-follow-up-email
Open

Sheetal phase3 Re Engagement Strategies No Show Follow Up Email#1333
sheetalmangate wants to merge 30 commits intodevelopmentfrom
sheetal-phase3-backend-re-engagement-strategies-follow-up-email

Conversation

@sheetalmangate
Copy link
Copy Markdown

@sheetalmangate sheetalmangate commented Apr 12, 2025

Description

Phase 3 - Development for Re-Engagement Strategies
URL : /communityportal/activity/:activityid/logattendance
Details:
Implement automated follow-up email functionality for participants who missed events.
Include dynamic options for:
Rescheduling opportunities.
Suggestions for alternative event formats.

no-show-rate-tracking

Related PRS (if any):

This backend PR is related to the PR#3409 frontend PR.
To test this backend PR you need to

  1. Checkout the PR#3409 frontend PR.

Main changes explained:

  • Implemented a functionality to send email to participants who missed the event.
  • Created mock data file with dummy participant. to test this functionality change dummy email ids with your test email id in noShowFollowUpEmailMockData.js

How to test:

  1. Check into current branch
  2. Do npm install
  3. Do npm run dev to start backend server
  4. Setup Gmail API to send emails from local
  5. Testing through postman use endpoint : api/communityportal/sendFollowUpEmailAll . this will send email to all participants included in src/controllers/CommunityPortal/noShowFollowUpEmailMockData.js
  6. For testing this PR using front end please checkout front end PR#XXX
  7. To check test emails you need to edit noShowFollowUpEmailMockData.js file and add your email. currently this file is containing dummy emails.

Gmail API

Before testing, you need to set up your own test email id to send the mail notification.
This is only for test purposes. Once tested you can revert these changes..

To send an email using the Gmail API with OAuth2 and nodemailer, follow the video below and set it up.
https://www.youtube.com/watch?v=-rcRf7yswfM&t=10s&ab_channel=MafiaCodes

Fill in the these variable values from the above setup in the .env file of the backend.
REACT_APP_EMAIL =
REACT_APP_EMAIL_CLIENT_ID =
REACT_APP_EMAIL_CLIENT_SECRET =
REACT_APP_EMAIL_REFRESH_TOKEN =
REACT_APP_EMAIL_CLIENT_REDIRECT_URI = https://developers.google.com/oauthplayground
sendEmail = true

NOTE: if you get a 403 error ("Access blocked: emailapi has not completed the Google verification process") when you reach the part around 6 minutes, go to console.cloud.google.com -> OAuth Consent Screen and then add your email to "Test users". It's not mentioned in the YouTube video but I saw it in one of the comments.

image

credit to PR479, thank you @AaronPersaud

Screenshots or videos of changes:

functionality_recording_for_pr.mp4

Note:

Email template functionality is handled in another task so currently using hardcoded email content.

@Yash-OCG
Copy link
Copy Markdown

Yash-OCG commented May 4, 2025

@sheetalmangate plz change the label to review first and get atleast 3 approvals

@sheetalmangate sheetalmangate added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label May 10, 2025
Copy link
Copy Markdown
Contributor

@rahul07bagul rahul07bagul left a comment

Choose a reason for hiding this comment

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

Functionality is working as expected, tested from postman and frontend.

Note: no idea how we are going to handle participants data once it gets deployed, currently it's hard coded.

Some suggestions:

  • The email subject line is duplicated. You can define it once.
    You can use: const getEmailSubject = (eventName) => Sorry we missed you at ${eventName};

  • The core logic for preparing and sending emails is very similar in both sendFollowUpEmailAll and sendFollowUpEmail.
    Below code is almost same in both, except filter part in second function which you can define outside and pass filteredRecipients

const subject = `Sorry we missed you at ${eventName}`;

        const updatedRecipients = recipients
            .filter((recipient) => selectedPraticipants.includes(recipient.participantID))
            .map((recipient)=>{
              const body = getFollowUpEmailBody( recipient.name, eventName, eventDate, eventTime )
              return { ...recipient, message: body };
            });
  • noShowRouter.route('/sendFollowUpEmailAll').get(controller.sendFollowUpEmailAll); - this should be POST not GET.

Copy link
Copy Markdown
Contributor

@bhanuanishakkineni bhanuanishakkineni left a comment

Choose a reason for hiding this comment

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

Hello Sheetal,
I have reviewed and tested this PR. Please find the comments and screenshots from the frontend PR #3409

Copy link
Copy Markdown

@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 Sheetal,

I have reviewed your PR locally and have been able to receive the API response.
Screenshot 2026-01-06 at 11 51 12 PM

Copy link
Copy Markdown

@Ganesh112001 Ganesh112001 left a comment

Choose a reason for hiding this comment

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

Hi Sheetal, Tried to test PR#1333
Attempted to test this backend PR but encountered multiple missing npm packages that are not in package.json:

  • geoip-lite
  • @aws-sdk/client-s3
  • @paypal/checkout-server-sdk
  • joi

These dependencies prevent the backend from starting. Please update package.json to include all required dependencies before this PR can be tested.

…stsController, overviewReportHelper, routes, and AzureBlobImages
@sheetalmangate
Copy link
Copy Markdown
Author

Hi Sheetal, Tried to test PR#1333 Attempted to test this backend PR but encountered multiple missing npm packages that are not in package.json:

  • geoip-lite
  • @aws-sdk/client-s3
  • @paypal/checkout-server-sdk
  • joi

These dependencies prevent the backend from starting. Please update package.json to include all required dependencies before this PR can be tested.

Please try npm install

@sheetalmangate
Copy link
Copy Markdown
Author

Mistakenly closed this PR and reopening it using the “Reopen and comment” button.

@sheetalmangate sheetalmangate reopened this Feb 1, 2026
Copy link
Copy Markdown

@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 Sheetal,

Re-reviewed this on Jae's request and it works as per requirement and i was able to receive the email upon modifying the mock data.

Image Image Image

Comment on lines +24 to +30
const subject = `Sorry we missed you at ${eventName}`;

try {
const updatedRecipients = recipients.map((recipient) => {
const body = getFollowUpEmailBody( recipient.name, eventName, eventDate, eventTime )
return { ...recipient, message: body };
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested the log attendance follow-up email flow, selecting a participant, and sending the email. The email send completes, and I also verified the received message in Ethereal, but this is still using hardcoded Event 1 details and a fixed participant list instead of the selected activity from the route. This could be checked if the activityId is not being used to load the real event and no-show participants here, because the page is currently sending follow-up emails from static mock data rather than the actual activity being viewed.

Image

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants