Library › Coding AI › Nonprofit staff

Draft thank-you emails without sending them

Practice: Setting limits and rules. About 5 minutes.

About this exercise

Write a Google Apps Script function named draftThankYous that goes through the Gifts tab (header in row 1) and, for each row with Amount (C) of 100 or more and an empty Thanked column (E), creates a Gmail draft (never sends) to the email in B with the subject Thank you, <first name> from column A. Then it writes Draft into column E of that row. Body exactly: Thank you for your gift of $<amount> to Riverbend Food Share. One code block, at most 16 lines, then under 25 words outside the code.

Common mistakes when you ask AI for this

  • Not saying draft, not send. The AI sends the emails straight away, before the director can personalize them. Try: Add: "Create drafts only, never send."
  • Leaving the rows vague. The AI thanks everyone, including small gifts and people already thanked. Try: Add: "Only Amount 100 or more and Thanked empty."
  • Not giving the wording. The AI writes its own long thank-you and doesn't mark the row. Try: Give the exact subject and body, and say "then write Draft in column E".
  • Getting a menu of options. The AI likes to offer two or three versions of the script, so you're left to pick and test them yourself. Try: Add: "Give one script only, in one code block, no alternatives."
  • Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 12 words. Nothing else."

What a strong prompt includes

  • Says draft, not send
  • Sets which rows
  • Gives the wording
  • Marks the row
  • Caps the code length

Practice this now ↑

Related exercises