Mail merge sample silently picks the first draft when several drafts share the subject
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- backend
調査の方向性
solutions/automations/mail-merge/Code.js の getGmailTemplateFromDrafts_() から始め、sendEmails() が選択された下書きをどのように処理するかを追ってください。Gmail と Sheets のテストダブルを使うテストを追加するか、既存のテストを見つけてください。条件に一致する下書きが2件ある場合は送信呼び出しが0回となり、1件の場合は通常どおり送信されることを確認してください。一致する下書きが複数ある場合に送信前に処理を止め、一意の件名を求めるメッセージを表示すれば完了です。
索引モデルが 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 ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/apps-script-samples のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
-
123オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
-
مدرسةオープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
Schoolオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
Alvin Litana Mirasolオープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#659 · コメント 1 件 · リアクション 1 件 ·
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 日以内に返信