Mail merge sample silently picks the first draft when several drafts share the subject
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- backend
调研方向
从 solutions/automations/mail-merge/Code.js 中的 getGmailTemplateFromDrafts_() 开始,追踪 sendEmails() 如何处理选中的草稿。添加或查找使用 Gmail 和 Sheets 测试替身的测试;验证两个匹配的草稿会导致发送调用次数为零,而只有一个匹配项时仍会正常发送。完成标准:存在多个匹配项时,在发送前停止,并显示要求使用唯一主题的消息。
由索引模型根据 Issue 内容生成。
描述
getGmailTemplateFromDrafts_() in solutions/automations/mail-merge/Code.js selects the template with:
const draft = drafts.filter(subjectFilter_(subject_line))[0];
If the sender has two drafts with the same subject, for example an internal and a customer version of "Monthly update", the script uses whichever Gmail returns first, with its body and attachments, for every row in the sheet. Nothing tells the sender a choice was made.
We ran sendEmails() with Gmail and Sheets replaced by test doubles, using two drafts with the same subject and different attachments. Reversing the draft order changed which body and attachment went to every recipient. No real email was sent.
Proposed change: count the matching drafts and stop before sending if there is more than one, with a message asking the sender to make the subject unique. A test would check that two matches lead to zero send calls and one match sends normally.
Happy to send a pull request if this approach works for you.
— Emails.help
- 主要语言
- JavaScript
- 星标
- 5.3k
- 派生
- 2k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
googleworkspace/apps-script-samples 的其他 Issue
-
难度 5/5 一周以上 新手友好度 1/100
-
123未关闭
难度 5/5 一周以上 新手友好度 1/100
-
مدرسة未关闭
难度 5/5 一周以上 新手友好度 15/100
-
School未关闭
难度 5/5 一周以上 新手友好度 20/100
-
难度 5/5 一周以上 新手友好度 1/100
googleworkspace/apps-script-samples#659 · 1 条评论 · 1 个 reaction ·
查看 googleworkspace/apps-script-samples 的全部 Issue
相似的 Issue
-
bounty good first issue help wanted
难度 2/5 1-3 小时 新手友好度 78/100
fitzss/valun-open#15 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
Siderite/lichessTools#1929 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复