Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MailChimp Replacement Backend #1080

Open
wants to merge 11 commits into
base: development
Choose a base branch
from

Conversation

angelalalacheng
Copy link

Description

Related PRS (if any):

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

Main changes explained:

  • Update src/controllers/emailController.js for refactoring and use content id to ensure that the image can display correctly in Gmail
  • Update src/utilities/emailSender.js for refactoring the code

Before Testing

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

How to test:

  1. check into current branch
  2. do npm install and npm run dev to run this PR locally
  3. Clear site data/cache
  4. If you only want to send the testing email to your own testing accounts, you can add a search keyword in src/controllers/emailController.js like the following:
Screenshot 2024-08-20 at 9 23 17 PM
  1. See how to test in frontend #2595 frontend PR

Screenshots or videos of changes:

See frontend

Note:

See frontend

@angelalalacheng angelalalacheng added the Do Not Review Do not review or look at code without full context label Aug 21, 2024
@angelalalacheng angelalalacheng changed the title Angela mail chimp replacement MailChimp Replacement Backend Aug 21, 2024
@angelalalacheng angelalalacheng marked this pull request as ready for review August 21, 2024 04:28
@angelalalacheng angelalalacheng removed the Do Not Review Do not review or look at code without full context label Aug 21, 2024
@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 Sep 6, 2024
@Shreyav2000 Shreyav2000 self-requested a review September 7, 2024 06:08
Copy link

@vishnupriyaatheti vishnupriyaatheti left a comment

Choose a reason for hiding this comment

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

@angelalalacheng I am trying to setup that was described in youtube video. To authorize the Api I am getting below attached error. Can you please suggest what wrong I am doing.
BE PR 1080

@angelalalacheng
Copy link
Author

angelalalacheng commented Sep 22, 2024

@angelalalacheng I am trying to setup that was described in youtube video. To authorize the Api I am getting below attached error. Can you please suggest what wrong I am doing. BE PR 1080

Hi, @vishnupriyaatheti
Sorry about that I have no idea about this error. I google it and also asked GPT andbutnot sure whether it is helpful.

The issue you’re facing is due to the fact that your application hasn’t completed the Google API verification process. When using Google APIs, such as the Gmail API, the app needs to go through a security and verification process by Google to ensure it complies with privacy and security standards.

The error message “Access blocked: Gmail API tutorial has not completed the Google verification process” indicates that the app is still in testing and can only be accessed by developer-approved testers. The app is blocked from wider access because it hasn’t been fully verified.

Copy link

@Ankuriboh Ankuriboh left a comment

Choose a reason for hiding this comment

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

Code was great, except that we need to reconsider the necessity of the queue system.

Asides from this, it somewhat a hassle to use Gmail as our email provider. I would suggest that we move to a real bulk mail sender other than Mailchimp to solve the issue.

logger.logInfo(`Email sent: ${JSON.stringify(result)}`);
};

const processBatch = async (batch) => {

Choose a reason for hiding this comment

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

Not sure why do we need to set up an email queue system? If we are sending emails to a mass amount of users or just send to a list of users, we can just BCC it. And that would only cost one request to the email server.

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.

4 participants