Send email notification when @mentioned in task 📧

オープン
#626 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
express, javascript, mongodb, node.js
領域
api, backend

調査の方向性

Start by reading the task routes in server/routes/tasks.js and checking how users and email configuration are handled in the project. The issue proposes notifying users mentioned in a task description on create and update, and adding SMTP settings to .env.example. Done means both routes send the specified notification to matched users and the email setup is documented; verify the relevant task routes and tests.

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue

Send email notification when @mentioned in task 📧

File: server/routes/tasks.js

You can @mention people in descriptions
but they never get notified 💀 fr!!

Fix: parse mentions on task save:
const nodemailer = require('nodemailer')

const extractMentions = (text) => {
const matches = text.match(/@(\w+)/g) || []
return matches.map(m => m.slice(1))
}

// in POST /api/tasks and PUT /api/tasks/🆔
const mentions = extractMentions(
req.body.description || ''
)

if (mentions.length > 0) {
const mentionedUsers = await User.find({
name: { $in: mentions }
})
// send email to each mentioned user
mentionedUsers.forEach(async (user) => {
await transporter.sendMail({
to: user.email,
subject: 'You were mentioned in DevBoard',
text: You were mentioned in task: "${req.body.title}"
})
})
}

Add SMTP config to .env.example:
[email protected]
EMAIL_PASS=your_app_password

~20 lines! nodemailer package needed 🎯
Real team collaboration feature!! 🔥

主要言語
JavaScript
スター
39
フォーク
105
平均マージ
2日 10時間
マージ済み PR(30日)
22

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anoopcodehack/DevBoard のほかの issue

anoopcodehack/DevBoard の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。