Reads a page each prospect has published and opens their email on a line checked back against that page, or on nothing at all.

UsesClaudeGmailGoogle SheetsJina AI

Open a cold email on something they actually published

Give it a sheet of prospects, each with a link to something they have published, and run it by hand. Each page is read, the AI writes an opening line about something that page actually says and a short first email around it, and the email goes out from Gmail with your sign-off and opt-out line added.

Every opening line has to come with the passage of the page it rests on, and that passage is matched back against the words on the page. If it is not there, or the line uses a figure the page never mentions, the email opens on a plain sentence that claims nothing. A draft that implies you have spoken before, or states a figure found neither on the page nor in your own words, is discarded rather than sent. Each send is recorded on a sent log before it goes out and every address is checked against that log, so nobody is emailed twice. If Gmail refuses an email, that person is taken back off the log and the run stops, saying why.

You need Google Sheets, Jina, Anthropic and Gmail connected, a prospect tab with 'Email', 'Name', 'Company' and 'Page URL' columns, and your own words for what you offer, your sign-off and your opt-out line. Sending commercial email, and the consent behind it, remains your responsibility.

Set sheetUrl to blank.Set sheetUrl to blank.
Set prospectTabName to blank.Set prospectTabName to blank.
Set sentLogTabName to “Sent log”.Set sentLogTabName to “Sent log”.
Set whatYouOffer to blank.Set whatYouOffer to blank.
Set senderSignOff to blank.Set senderSignOff to blank.
Set optOutLine to blank.Set optOutLine to blank.
Set maxEmailsThisRun to 1.Set maxEmailsThisRun to 1.
If sentLogTabName is blankIf sentLogTabName is blank
Yes
Change sentLogTabName to “Sent log”.Change sentLogTabName to “Sent log”.
No
No steps
Set sendLimit to maxEmailsThisRun multiplied by 1.Set sendLimit to maxEmailsThisRun multiplied by 1.
If sendLimit is less than 1 or sendLimit is greater than 200If sendLimit is less than 1 or sendLimit is greater than 200
Yes
Stop and report a problem: 'maxEmailsThisRun' must be a whole number between 1 and 200. Set it in the 'maxEmailsThisRun' step and run it again.Stop and report a problem: 'maxEmailsThisRun' must be a whole number between 1 and 200. Set it in the 'maxEmailsThisRun' step and run it again.
No
No steps
Set sentLogIsNew to true.Set sentLogIsNew to true.
If a step below fails, save the error as createLogTabErrorIf a step below fails, save the error as createLogTabError
Try
Google SheetsGoogle SheetsCreate the tab sentLogTabName in sheetUrl.Create the tab sentLogTabName in sheetUrl.
On error
Change sentLogIsNew to false.Change sentLogIsNew to false.
If sentLogIsNew is yesIf sentLogIsNew is yes
Yes
Google SheetsGoogle SheetsAdd a row to sentLogTabName in sheetUrl.Add a row to sentLogTabName in sheetUrl.
No
No steps
Google SheetsGoogle SheetsRead column 'A' of sentLogTabName in sheetUrl. Save it as sentLog.Read column 'A' of sentLogTabName in sheetUrl. Save it as sentLog.
Set alreadySent to an empty list.Set alreadySent to an empty list.
For each loggedAddress in sentLog.values:For each loggedAddress in sentLog.values:
If a step below fails, save the error as loggedAddressErrorIf a step below fails, save the error as loggedAddressError
Try
Add loggedAddress in lowercase to the end of alreadySent and save it as alreadySent.Add loggedAddress in lowercase to the end of alreadySent and save it as alreadySent.
On error
Show in the output: Ignored a cell in the '@sentLogTabName' tab that is not text.Show in the output: Ignored a cell in the '@sentLogTabName' tab that is not text.
Google SheetsGoogle SheetsRead the rows of sheetUrl. Save it as prospectSheet.Read the rows of sheetUrl. Save it as prospectSheet.
Set sentCount to 0.Set sentCount to 0.
Set skippedRows to 0.Set skippedRows to 0.
Set stoppedAtLimit to false.Set stoppedAtLimit to false.
For each row in prospectSheet.rows:For each row in prospectSheet.rows:
If sentCount is greater than or equal to sendLimitIf sentCount is greater than or equal to sendLimit
Yes
Change stoppedAtLimit to true.Change stoppedAtLimit to true.
Stop repeating.Stop repeating.
No
No steps
Set rowLabel to “row row.row_number as text”.Set rowLabel to “row row.row_number as text”.
Set recipient to blank.Set recipient to blank.
If a step below fails, save the error as recipientReadErrorIf a step below fails, save the error as recipientReadError
Try
Trim row.Email and save it as recipient.Trim row.Email and save it as recipient.
On error
Change recipient to blank.Change recipient to blank.
If recipient is emptyIf recipient is empty
Yes
Show in the output: Skipped rowLabel: the Email column is empty.Show in the output: Skipped rowLabel: the Email column is empty.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
If not recipient is a valid email addressIf not recipient is a valid email address
Yes
Show in the output: Skipped rowLabel: '@recipient' is not a valid email address, so nothing was sent to it.Show in the output: Skipped rowLabel: '@recipient' is not a valid email address, so nothing was sent to it.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
TextMake recipient lowercase and save it as recipientKey.Make recipient lowercase and save it as recipientKey.
If alreadySent contains recipientKeyIf alreadySent contains recipientKey
Yes
Show in the output: Skipped recipient: already on the sent log, so they are not emailed twice.Show in the output: Skipped recipient: already on the sent log, so they are not emailed twice.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Set contactName to blank.Set contactName to blank.
If a step below fails, save the error as contactNameReadErrorIf a step below fails, save the error as contactNameReadError
Try
Trim row.Name and save it as contactName.Trim row.Name and save it as contactName.
On error
Change contactName to blank.Change contactName to blank.
Set companyName to blank.Set companyName to blank.
If a step below fails, save the error as companyNameReadErrorIf a step below fails, save the error as companyNameReadError
Try
Trim row.Company and save it as companyName.Trim row.Company and save it as companyName.
On error
Change companyName to blank.Change companyName to blank.
Set pageUrl to blank.Set pageUrl to blank.
If a step below fails, save the error as pageUrlReadErrorIf a step below fails, save the error as pageUrlReadError
Try
Trim row["Page URL"] and save it as pageUrl.Trim row["Page URL"] and save it as pageUrl.
On error
Change pageUrl to blank.Change pageUrl to blank.
If companyName is emptyIf companyName is empty
Yes
Show in the output: Skipped recipient: the Company column is empty.Show in the output: Skipped recipient: the Company column is empty.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
If pageUrl is empty or pageUrl is “null” or pageUrl doesn't start with…If pageUrl is empty or pageUrl is “null” or pageUrl doesn't start with…
Yes
Show in the output: Skipped recipient: the Page URL column does not hold an https:// web address, and this template has nothing to open on without one.Show in the output: Skipped recipient: the Page URL column does not hold an https:// web address, and this template has nothing to open on without one.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Set pageText to blank.Set pageText to blank.
If a step below fails, save the error as pageReadErrorIf a step below fails, save the error as pageReadError
Try
Trim the content from the Jina AI “Read a URL” step and save it as pageText.Trim the content from the Jina AI “Read a URL” step and save it as pageText.
On error
Show in the output: Could not read pageUrl for recipient.Show in the output: Could not read pageUrl for recipient.
If pageText is “null”If pageText is “null”
Yes
Change pageText to blank.Change pageText to blank.
No
No steps
Set openingLine to blank.Set openingLine to blank.
Set openerEvidence to blank.Set openerEvidence to blank.
Set openerSource to “generic”.Set openerSource to “generic”.
If the length of pageText is greater than or equal to 400If the length of pageText is greater than or equal to 400
Yes
Shorten pageText to 6000 characters and save it as pageExcerpt.Shorten pageText to 6000 characters and save it as pageExcerpt.
Set openerPrompt to You are reading one page a person has published, and writing the first sentence of a cold email to them.Set openerPrompt to You are reading one page a person has published, and writing the first sentence of a cold email to them. Everything you write must be supported by the PAGE TEXT below and nothing else. Do not use anything you already know about this person or this company. Do not guess, estimate or round any number. Do not describe anything the page does not state. Do not mention or imply anyone's age, gender, race, nationality, religion, health, disability, politics or family. Reply in exactly this shape and nothing else: EVIDENCE: <one span of at least 25 characters, copied word for word out of the page text, that the opening sentence rests on> OPENER: <one sentence, under 240 characters, saying only what that span says> If the page gives you nothing specific worth opening on, reply with the single word NOTHING and no other line. THE PERSON Name: contactName Company: companyName Page: pageUrl PAGE TEXT pageExcerpt.
ClaudeClaudeAsk Claude: openerPrompt. Save it as openerReply.Ask Claude: openerPrompt. Save it as openerReply. Maximum response length: 400
Set openerText to blank.Set openerText to blank.
If a step below fails, save the error as openerReadErrorIf a step below fails, save the error as openerReadError
Try
Trim openerReply.response_text and save it as openerText.Trim openerReply.response_text and save it as openerText.
On error
Change openerText to blank.Change openerText to blank.
For each replyLine in openerText split by a new line:For each replyLine in openerText split by a new line:
Trim replyLine and save it as trimmedLine. Trim replyLine and save it as trimmedLine.
If trimmedLine starts with “EVIDENCE:” (ignoring case) If trimmedLine starts with “EVIDENCE:” (ignoring case)
Yes
Trim trimmedLine with “EVIDENCE:” replaced by “” (ignoring case) and save it as openerEvidence.Trim trimmedLine with “EVIDENCE:” replaced by “” (ignoring case) and save it as openerEvidence.
No
No steps
If trimmedLine starts with “OPENER:” (ignoring case) If trimmedLine starts with “OPENER:” (ignoring case)
Yes
Trim trimmedLine with “OPENER:” replaced by “” (ignoring case) and save it as openingLine.Trim trimmedLine with “OPENER:” replaced by “” (ignoring case) and save it as openingLine.
No
No steps
Replace the pattern “\]\([^)]*\)” with “ ” in pageExcerpt and save it as pageWithoutLinkTargets.Replace the pattern “\]\([^)]*\)” with “ ” in pageExcerpt and save it as pageWithoutLinkTargets.
Replace the pattern “[\W_]+” with “ ” in pageWithoutLinkTargets and save it as pageWords.Replace the pattern “[\W_]+” with “ ” in pageWithoutLinkTargets and save it as pageWords.
Replace the pattern “\]\([^)]*\)” with “ ” in openerEvidence and save it as evidenceWithoutLinkTargets.Replace the pattern “\]\([^)]*\)” with “ ” in openerEvidence and save it as evidenceWithoutLinkTargets.
Replace the pattern “[\W_]+” with “ ” in evidenceWithoutLinkTargets and save it as evidenceSpaced.Replace the pattern “[\W_]+” with “ ” in evidenceWithoutLinkTargets and save it as evidenceSpaced.
Trim evidenceSpaced and save it as evidenceWords.Trim evidenceSpaced and save it as evidenceWords.
Set evidenceIsReal to the length of evidenceWords is greater than or equal to 20 and pageWords contains evidenceWords (ignoring case).Set evidenceIsReal to the length of evidenceWords is greater than or equal to 20 and pageWords contains evidenceWords (ignoring case).
Extract all matches from openingLine and save it as openerFigures.Extract all matches from openingLine and save it as openerFigures.
Set figuresAreInThePage to true.Set figuresAreInThePage to true.
For each figure in openerFigures:For each figure in openerFigures:
If pageText doesn't contain figure (ignoring case) If pageText doesn't contain figure (ignoring case)
Yes
Change figuresAreInThePage to false.Change figuresAreInThePage to false.
No
No steps
Set openerLooksLikeASentence to the length of openingLine is greater than or equal to 20 and the length of openingLine is less than or equal to 260.Set openerLooksLikeASentence to the length of openingLine is greater than or equal to 20 and the length of openingLine is less than or equal to 260.
Set openerClaimsGroup1 to openingLine contains “as we discussed” (ignoring case) or openingLine contains “as discussed” (ignoring case) or openingLine contains “following up on our call” (ignoring case) or openingLine contains “as promised” (ignoring case) or openingLine contains “per our conversation” (ignoring case).Set openerClaimsGroup1 to openingLine contains “as we discussed” (ignoring case) or openingLine contains “as discussed” (ignoring case) or openingLine contains “following up on our call” (ignoring case) or openingLine contains “as promised” (ignoring case) or openingLine contains “per our conversation” (ignoring case).
Set openerClaimsGroup2 to openingLine contains “great speaking” (ignoring case) or openingLine contains “we spoke” (ignoring case) or openingLine contains “our meeting” (ignoring case) or openingLine contains “thanks for your time” (ignoring case) or openingLine contains “since we last” (ignoring case).Set openerClaimsGroup2 to openingLine contains “great speaking” (ignoring case) or openingLine contains “we spoke” (ignoring case) or openingLine contains “our meeting” (ignoring case) or openingLine contains “thanks for your time” (ignoring case) or openingLine contains “since we last” (ignoring case).
Set openerClaimsGroup3 to openingLine contains “you asked me to” (ignoring case) or openingLine contains “you requested” (ignoring case) or openingLine contains “circling back” (ignoring case) or openingLine contains “as agreed” (ignoring case).Set openerClaimsGroup3 to openingLine contains “you asked me to” (ignoring case) or openingLine contains “you requested” (ignoring case) or openingLine contains “circling back” (ignoring case) or openingLine contains “as agreed” (ignoring case).
If evidenceIsReal is yes and figuresAreInThePage is yes and…If evidenceIsReal is yes and figuresAreInThePage is yes and…
Yes
Change openerSource to “from the page”.Change openerSource to “from the page”.
No
Show in the output: Nothing on pageUrl could be checked against the page, so recipient gets a plain opening line instead of an invented one.Show in the output: Nothing on pageUrl could be checked against the page, so recipient gets a plain opening line instead of an invented one.
Change openingLine to blank.Change openingLine to blank.
Change openerEvidence to blank.Change openerEvidence to blank.
No
Show in the output: There was not enough text on pageUrl to open on, so recipient gets a plain opening line.Show in the output: There was not enough text on pageUrl to open on, so recipient gets a plain opening line.
If openingLine is emptyIf openingLine is empty
Yes
Change openerSource to “generic”.Change openerSource to “generic”.
Change openingLine to “I am writing to a few people at companyName and thought you might be the right person to ask.”.Change openingLine to “I am writing to a few people at companyName and thought you might be the right person to ask.”.
Change openerEvidence to “nothing on the page could be checked, so no claim was made”.Change openerEvidence to “nothing on the page could be checked, so no claim was made”.
No
No steps
Set emailPrompt to "Write one short first-contact email.Set emailPrompt to “Write one short first-contact email. The body must begin with this sentence, word for word and unchanged: {opening} After that sentence, say only what is written under WHY I AM WRITING below. Do not add any other fact, figure, date or claim about the recipient or their company - not one you know from elsewhere, and not one you infer. Never suggest we have met, spoken, emailed or been introduced. Do not use digits anywhere in the email. If you need a number, write it as a word - 'fifteen minutes', not '15 minutes'. 100 words at most after the opening sentence. No sign-off, no signature and no opt-out line: those are added afterwards. Reply in exactly this shape and nothing else: Subject: <a specific subject line, under 70 characters> <blank line> <the body, starting with the opening sentence above>” with “{opening}” replaced by openingLine THE PERSON Name: contactName Company: companyName WHY I AM WRITING, in my own words: whatYouOffer.
ClaudeClaudeAsk Claude: emailPrompt. Save it as drafted.Ask Claude: emailPrompt. Save it as drafted. Maximum response length: 700
Set draftText to blank.Set draftText to blank.
If a step below fails, save the error as draftReadErrorIf a step below fails, save the error as draftReadError
Try
Trim drafted.response_text and save it as draftText.Trim drafted.response_text and save it as draftText.
On error
Change draftText to blank.Change draftText to blank.
If draftText is empty or draftText is “null”If draftText is empty or draftText is “null”
Yes
Show in the output: Skipped recipient: the model returned no draft.Show in the output: Skipped recipient: the model returned no draft.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Split draftText by a new line and save it as draftLines.Split draftText by a new line and save it as draftLines.
Trim the first item of draftLines with “Subject:” replaced by “” (ignoring case) and save it as emailSubject.Trim the first item of draftLines with “Subject:” replaced by “” (ignoring case) and save it as emailSubject.
Trim the items from index 1 onward of draftLines joined by a new line and save it as emailBodyText.Trim the items from index 1 onward of draftLines joined by a new line and save it as emailBodyText.
If emailSubject is empty or the length of emailSubject is greater than 120 or the…If emailSubject is empty or the length of emailSubject is greater than 120 or the…
Yes
Show in the output: Skipped recipient: the draft did not come back as a subject line and a body.Show in the output: Skipped recipient: the draft did not come back as a subject line and a body.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
If emailBodyText doesn't contain openingLineIf emailBodyText doesn't contain openingLine
Yes
Show in the output: Skipped recipient: the draft rewrote the opening line that had been checked against the page, so it was thrown away.Show in the output: Skipped recipient: the draft rewrote the opening line that had been checked against the page, so it was thrown away.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Set wholeDraft to emailSubjectSet wholeDraft to emailSubject emailBodyText.
Set claimsGroup1 to wholeDraft contains “as we discussed” (ignoring case) or wholeDraft contains “as discussed” (ignoring case) or wholeDraft contains “following up on our call” (ignoring case) or wholeDraft contains “as promised” (ignoring case) or wholeDraft contains “per our conversation” (ignoring case).Set claimsGroup1 to wholeDraft contains “as we discussed” (ignoring case) or wholeDraft contains “as discussed” (ignoring case) or wholeDraft contains “following up on our call” (ignoring case) or wholeDraft contains “as promised” (ignoring case) or wholeDraft contains “per our conversation” (ignoring case).
Set claimsGroup2 to wholeDraft contains “great speaking” (ignoring case) or wholeDraft contains “we spoke” (ignoring case) or wholeDraft contains “our meeting” (ignoring case) or wholeDraft contains “thanks for your time” (ignoring case) or wholeDraft contains “since we last” (ignoring case).Set claimsGroup2 to wholeDraft contains “great speaking” (ignoring case) or wholeDraft contains “we spoke” (ignoring case) or wholeDraft contains “our meeting” (ignoring case) or wholeDraft contains “thanks for your time” (ignoring case) or wholeDraft contains “since we last” (ignoring case).
Set claimsGroup3 to wholeDraft contains “you asked me to” (ignoring case) or wholeDraft contains “you requested” (ignoring case) or wholeDraft contains “circling back” (ignoring case) or wholeDraft contains “as agreed” (ignoring case).Set claimsGroup3 to wholeDraft contains “you asked me to” (ignoring case) or wholeDraft contains “you requested” (ignoring case) or wholeDraft contains “circling back” (ignoring case) or wholeDraft contains “as agreed” (ignoring case).
If claimsGroup1 is yes or claimsGroup2 is yes or claimsGroup3 is yesIf claimsGroup1 is yes or claimsGroup2 is yes or claimsGroup3 is yes
Yes
Show in the output: Skipped recipient: the draft implied you had already been in touch, which is not true of a first email, so nothing was sent.Show in the output: Skipped recipient: the draft implied you had already been in touch, which is not true of a first email, so nothing was sent.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Set sourceMaterial to pageTextSet sourceMaterial to pageText whatYouOffer companyName contactName openingLine.
Extract all matches from wholeDraft and save it as draftFigures.Extract all matches from wholeDraft and save it as draftFigures.
Set draftIsTraceable to true.Set draftIsTraceable to true.
For each draftFigure in draftFigures:For each draftFigure in draftFigures:
If sourceMaterial doesn't contain draftFigure (ignoring case)If sourceMaterial doesn't contain draftFigure (ignoring case)
Yes
Change draftIsTraceable to false.Change draftIsTraceable to false.
No
No steps
If draftIsTraceable is noIf draftIsTraceable is no
Yes
Show in the output: Skipped recipient: the draft stated a figure that is not on the page it read or in your own words, so it was thrown away rather than sent.Show in the output: Skipped recipient: the draft stated a figure that is not on the page it read or in your own words, so it was thrown away rather than sent.
Add 1 to skippedRows.Add 1 to skippedRows.
Skip to the next item.Skip to the next item.
No
No steps
Set emailBody to emailBodyTextSet emailBody to emailBodyText senderSignOff optOutLine.
Google SheetsGoogle SheetsAdd a row to sentLogTabName in sheetUrl.Add a row to sentLogTabName in sheetUrl.
Add recipientKey to the end of alreadySent and save it as alreadySent.Add recipientKey to the end of alreadySent and save it as alreadySent.
If a step below fails, save the error as sendErrorIf a step below fails, save the error as sendError
Try
GmailGmailSend an email to recipient.Send an email to recipient. Subject: emailSubjectemailBody
On error
Set takenOffLog to false.Set takenOffLog to false.
If a step below fails, save the error as unlogErrorIf a step below fails, save the error as unlogError
Try
Google SheetsGoogle SheetsRead column 'A' of sentLogTabName in sheetUrl. Save it as logNow.Read column 'A' of sentLogTabName in sheetUrl. Save it as logNow.
Find the position of recipient in logNow.values and save it as logPosition.Find the position of recipient in logNow.values and save it as logPosition.
If logPosition is greater than or equal to 1If logPosition is greater than or equal to 1
Yes
Set logRowNumber to logPosition plus 1.Set logRowNumber to logPosition plus 1.
Google SheetsGoogle SheetsDelete row logRowNumber from sentLogTabName in sheetUrl.Delete row logRowNumber from sentLogTabName in sheetUrl.
Change takenOffLog to true.Change takenOffLog to true.
No
No steps
On error
No steps
If takenOffLog is yesIf takenOffLog is yes
Yes
Stop and report a problem: [“Gmail did not send the email to ”, recipient, “ (”, sendError.message, “). The run stopped there, after ”, sentCount as text, “ email(s) went out. ”, recipient, “ was taken off the '”, sentLogTabName, “' tab, so the next run tries them again. Check that Gmail is still connected, then run it again.”] joined by nothing.Stop and report a problem: [“Gmail did not send the email to ”, recipient, “ (”, sendError.message, “). The run stopped there, after ”, sentCount as text, “ email(s) went out. ”, recipient, “ was taken off the '”, sentLogTabName, “' tab, so the next run tries them again. Check that Gmail is still connected, then run it again.”] joined by nothing.
No
Stop and report a problem: [“Gmail did not send the email to ”, recipient, “ (”, sendError.message, “). The run stopped there, after ”, sentCount as text, “ email(s) went out. ”, recipient, “ is still on the '”, sentLogTabName, “' tab although nothing reached them: delete their row there so the next run tries them again, then check that Gmail is still connected.”] joined by nothing.Stop and report a problem: [“Gmail did not send the email to ”, recipient, “ (”, sendError.message, “). The run stopped there, after ”, sentCount as text, “ email(s) went out. ”, recipient, “ is still on the '”, sentLogTabName, “' tab although nothing reached them: delete their row there so the next run tries them again, then check that Gmail is still connected.”] joined by nothing.
Add 1 to sentCount.Add 1 to sentCount.
Show in the output: Sent sentCount as text opening emails. Skipped skippedRows as text rows.Show in the output: Sent sentCount as text opening emails. Skipped skippedRows as text rows.
If stoppedAtLimit is yesIf stoppedAtLimit is yes
Yes
Show in the output: [“It stopped at the limit of ”, sendLimit as text, “ email(s) set in 'maxEmailsThisRun'. Run it again to carry on down the list.”] joined by nothing.Show in the output: [“It stopped at the limit of ”, sendLimit as text, “ email(s) set in 'maxEmailsThisRun'. Run it again to carry on down the list.”] joined by nothing.
No
No steps