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

Nodemailer Email Implementation #981

Open
MinhxNguyen7 opened this issue May 6, 2024 · 1 comment · May be fixed by #984
Open

Nodemailer Email Implementation #981

MinhxNguyen7 opened this issue May 6, 2024 · 1 comment · May be fixed by #984
Assignees
Labels
enhancement Improvements to the user experience

Comments

@MinhxNguyen7
Copy link
Member

@ap0nia please add notes.

@MinhxNguyen7 MinhxNguyen7 added the enhancement Improvements to the user experience label May 6, 2024
@ap0nia
Copy link
Collaborator

ap0nia commented May 6, 2024

Steps

  1. Get Google refresh token for OAuth project, e.g. via Google Developer Playground -- I can provide this.
  2. Install nodemailer npm package.
  3. Write a function that can send an email, based on the provided interface below.
  4. To test this, can make it an endpoint on the backend (can ask for help if needed).
  5. Report back for next steps.

Details

Function signature

// Map user ID to section codes that the user is subscribed to.
export const exampleDb = {
  user1: {
    subscriptions: [1, 2, 3],
    email: 'user1@gmail.com'
  },
  user2: {
    subscriptions: [1, 5, 9],
    email: 'user2@gmail.com',
  },
  user3: {
    subscriptions: [2, 7, 9],
    email: 'user3@gmail.com',
}

// Information 
export type ClassUpdate = { 
  section: number
  status: string
}

export type NotifyParams = {
  updates: ClassUpdate[]
}

import nodemailer from 'nodemailer'

async function notify(params: NotifyParams) {
  //
}

@tig-github tig-github self-assigned this May 6, 2024
@tig-github tig-github linked a pull request May 20, 2024 that will close this issue
@tig-github tig-github linked a pull request May 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to the user experience
Projects
Status: Backlog 🥱
Development

Successfully merging a pull request may close this issue.

3 participants