Every day, emails the next few leads in your sheet a random article with a short AI note, and comes back to each after a set gap.
Uses
Claude
Gmail
Google Sheets
Drip helpful articles to your leads
spreadsheetUrl to blank.Set spreadsheetUrl to blank.leadsTabName to blank.Set leadsTabName to blank.articlesTabName to blank.Set articlesTabName to blank.sentTabName to blank.Set sentTabName to blank.senderContext to blank.Set senderContext to blank.signOff to blank.Set signOff to blank.optOutLine to If you would rather not get these, just reply and say so..Set optOutLine to If you would rather not get these, just reply and say so..leadsPerDay to 5.Set leadsPerDay to 5.daysBetweenEmails to 7.Set daysBetweenEmails to 7.secondsBetweenEmails to 5.Set secondsBetweenEmails to 5.spreadsheetUrl. Save it as leadsRead.Read the rows of spreadsheetUrl. Save it as leadsRead.spreadsheetUrl. Save it as articlesRead.Read the rows of spreadsheetUrl. Save it as articlesRead.spreadsheetUrl. Save it as sentRead.Read the rows of spreadsheetUrl. Save it as sentRead.articlesRead.count is 0If articlesRead.count is 0Yes
No
No steps
leadsRead.count is 0If leadsRead.count is 0Yes
No
No steps
leads, articles, sent, now_text, leads_per_day, and days_between and save it as plan.Run Python code on leads, articles, sent, now_text, leads_per_day, and days_between and save it as plan.note in plan.notes:For each note in plan.notes:note.Show in the output: note.plan.articles is 0If plan.articles is 0Yes
No
No steps
plan.picks is emptyIf plan.picks is emptyYes
No
No steps
sentCount to 0.Set sentCount to 0.skippedCount to 0.Set skippedCount to 0.failedCount to 0.Set failedCount to 0.pick in plan.picks:For each pick in plan.picks:leadEmail to pick.email.Set leadEmail to pick.email.articleTitle to pick.title.Set articleTitle to pick.title.articleUrl to pick.url.Set articleUrl to pick.url.emailBody to blank.Set emailBody to blank.writeErrorIf a step below fails, save the error as writeErrorTry
senderContext
The lead:
pick.facts
The article to share:
pick.article_facts
Write the email body only, as plain text with no subject line, no markdown and no sign-off (the sender's own sign-off is added afterwards). Start with 'Hi ' followed by the lead's first name and a comma. Then two or three short paragraphs: one line on why this seemed worth sending them, what it covers in a sentence or two drawn only from the summary, and the link on its own line exactly as written above. Close with one light sentence that leaves the door open, with no pressure. Keep the whole thing under 150 words.'. Save it as written.
Maximum response length: 600written.response_text and save it as emailBody.Trim written.response_text and save it as emailBody.On error
leadEmail: writeError as text.Show in the output: Could not write the note for leadEmail: writeError as text.emailBody is emptyIf emailBody is emptyYes
leadEmail, so they are left for the next run.Show in the output: No note came back for leadEmail, so they are left for the next run.skippedCount.Add 1 to skippedCount.No
No steps
emailBody doesn't contain articleUrlIf emailBody doesn't contain articleUrlYes
emailBody to emailBodyChange emailBody to emailBody
articleUrl.No
No steps
emailBody to emailBodyChange emailBody to emailBody
signOff
optOutLine.sentCount is greater than 0If sentCount is greater than 0Yes
secondsBetweenEmails seconds.Wait for secondsBetweenEmails seconds.No
No steps
recorded to false.Set recorded to false.recordErrorIf a step below fails, save the error as recordErrorTry
sentTabName in spreadsheetUrl.Add a row to sentTabName in spreadsheetUrl.recorded to true.Change recorded to true.On error
leadEmail on the '@sentTabName' tab, so nothing was sent to them: recordError as text.Show in the output: Could not record the send for leadEmail on the '@sentTabName' tab, so nothing was sent to them: recordError as text.recorded is noIf recorded is noYes
skippedCount.Add 1 to skippedCount.No
No steps
sendErrorIf a step below fails, save the error as sendErrorTry
leadEmail.Send an email to leadEmail.
Subject: articleTitleemailBodysentCount.Add 1 to sentCount.leadEmail.Show in the output: Sent '@articleTitle' to leadEmail.On error
failedCount.Add 1 to failedCount.leadEmail: sendError as text - delete that row from the '@sentTabName' tab to try again next run.Show in the output: Recorded but could not send '@articleTitle' to leadEmail: sendError as text - delete that row from the '@sentTabName' tab to try again next run.sentCount as text article email(s), failedCount as text failed to send, skipped skippedCount as text, out of the length of plan.picks as text lead(s) in today's batch.Show in the output: Sent sentCount as text article email(s), failedCount as text failed to send, skipped skippedCount as text, out of the length of plan.picks as text lead(s) in today's batch.