Writes a reply to each new customer email in your Outlook inbox, in your business's voice, and saves it as a draft to check and send.
Uses
Claude
Microsoft Outlook
Draft replies to customer emails in Outlook
email.When an email arrives. Save it as email.aboutYourBusiness to:Set aboutYourBusiness to:What we do: [what your business does, for whom and where]
How we write: [your tone, for example friendly and plain-spoken, first names, no exclamation marks]
What a reply can say: [facts a reply may use, for example opening hours, how to book, where your help pages are]
What a reply must never promise: [for example refunds, discounts, prices, delivery or repair dates]signOffName to blank.Set signOffName to blank.skipSenders to [noreply, no-reply, no_reply, donotreply, do-not-reply, mailer-daemon, postmaster, bounce, bounces, notifications].Set skipSenders to [noreply, no-reply, no_reply, donotreply, do-not-reply, mailer-daemon, postmaster, bounce, bounces, notifications].skipSubjects to [automatic reply, auto-reply, autoreply, out of office, undeliverable, delivery status notification, delivery has failed, mail delivery failed].Set skipSubjects to [automatic reply, auto-reply, autoreply, out of office, undeliverable, delivery status notification, delivery has failed, mail delivery failed].email.message_id is empty or email.message_id is blankIf email.message_id is empty or email.message_id is blankYes
No
No steps
email.subject, or (no subject) if it is empty and save it as subject.Use email.subject, or (no subject) if it is empty and save it as subject.email.from, or an unknown sender if it is empty and save it as sentBy.Use email.from, or an unknown sender if it is empty and save it as sentBy.email.from_address lowercase and save it as sender.Make email.from_address lowercase and save it as sender.sender and save it as senderDomain.Extract the first domain from sender and save it as senderDomain.email.mailbox and save it as ownDomain.Extract the first domain from email.mailbox and save it as ownDomain.sender and save it as senderRule.Match keywords in sender and save it as senderRule.^[\s\[(]+ with in subject and save it as subjectStart.Replace the pattern ^[\s\[(]+ with in subject and save it as subjectStart.skipSubjects where item isn't blank and subjectStart starts with item (ignoring case) and save it as subjectMatches.Keep each item in skipSubjects where item isn't blank and subjectStart starts with item (ignoring case) and save it as subjectMatches.skipReason to blank.Set skipReason to blank.sender is blankIf sender is blankYes
skipReason to it has no sender address to reply to.Change skipReason to it has no sender address to reply to.Else if @ownDomain isn't blank and @senderDomain is @ownDom…
it came from inside your own organisation (@senderDomain) and save it as skipReason.Build the text it came from inside your own organisation (@senderDomain) and save it as skipReason.Else if @senderRule.is_match is yes
it came from an automatic address (@sender) and save it as skipReason.Build the text it came from an automatic address (@sender) and save it as skipReason.Else if @subjectMatches isn't empty
it is an automatic message (its subject starts with @subjectMatches[0]) and save it as skipReason.Build the text it is an automatic message (its subject starts with @subjectMatches[0]) and save it as skipReason.Otherwise
No steps
skipReason isn't blankIf skipReason isn't blankYes
@subject from sentBy: skipReason. The email was left as it is.Finish the run: No draft for @subject from sentBy: skipReason. The email was left as it is.No
No steps
\s*\n\s*\n\s* with "Replace the pattern \s*\n\s*\n\s* with
in email.body and save it as tidyBody.tidyBody to 12000 characters (keeping words whole) and save it as emailText.Shorten tidyBody to 12000 characters (keeping words whole) and save it as emailText.aiAnswer to an empty record.Set aiAnswer to an empty record.aiErrorIf a step below fails, save the error as aiErrorTry
sentBy T… and save it as drafting.Run an AI agent: Decide whether this email needs a reply and, if it does, write the reply. From: sentBy T… and save it as drafting.aiAnswer to drafting.output.Change aiAnswer to drafting.output.On error
@subject from sentBy, so no draft was saved and this email needs answering by hand. Check the Anthropic connection under Integrations. What went wrong: aiError.message.Stop and report a problem: Could not write a reply to @subject from sentBy, so no draft was saved and this email needs answering by hand. Check the Anthropic connection under Integrations. What went wrong: aiError.message.aiAnswer.needs_reply in lowercase is noIf aiAnswer.needs_reply in lowercase is noYes
@subject from sentBy: aiAnswer.reason The email was left as it is, with no draft.Finish the run: No reply needed for @subject from sentBy: aiAnswer.reason The email was left as it is, with no draft.Else if @aiAnswer.needs_reply in lowercase is not "yes"
@subject from sentBy needs a reply (it answered @aiAnswer.needs_reply), so no draft was saved and this email needs answering by hand.Stop and report a problem: The AI did not say whether @subject from sentBy needs a reply (it answered @aiAnswer.needs_reply), so no draft was saved and this email needs answering by hand.Otherwise
No steps
aiAnswer.reply is less than 20If the length of aiAnswer.reply is less than 20Yes
@subject from sentBy needs a reply but did not write one, so no draft was saved and this email needs answering by hand.Stop and report a problem: The AI said @subject from sentBy needs a reply but did not write one, so no draft was saved and this email needs answering by hand.No
No steps
draftErrorIf a step below fails, save the error as draftErrorTry
email. Save it as draft.Draft a reply to email email. Save it as draft.aiAnswer.reply@subject from sentBy in that email's conversation in Outlook, ready to check and send. About the email: aiAnswer.reason Open the draft: draft.webLink.Finish the run: Saved a draft reply to @subject from sentBy in that email's conversation in Outlook, ready to check and send. About the email: aiAnswer.reason Open the draft: draft.webLink.On error
@subject from sentBy was written, but Outlook would not save it as a draft, so nothing was saved and nothing was sent. Check that the app your Microsoft 365 admin registered for Lodol has the Mail.ReadWrite application permission with admin consent and can reach this mailbox, and that the email is still there. What Outlook said: draftError.messageStop and report a problem: A reply to @subject from sentBy was written, but Outlook would not save it as a draft, so nothing was saved and nothing was sent. Check that the app your Microsoft 365 admin registered for Lodol has the Mail.ReadWrite application permission with admin consent and can reach this mailbox, and that the email is still there. What Outlook said: draftError.message
The reply, to paste into Outlook yourself:
aiAnswer.reply.