Purpose
Sends the contents of a SharePoint hosted HTML file as the body of an outgoing email. Built for form letters like the new tech employee orientation letter, but works for any HTML file stored i
Trigger Mailbox
sendhtml@geekgirlsit.com (shared mailbox). Uses the "When a new email arrives in a shared mailbox (V2)" trigger, not the standard V3 trigger, since V3 only monitors the
connected account's own inbox and cannot watch a shared mailbox.
How to Use:
Send an email to sendhtml@geekgirlsit.com with three labeled lines, one per line, in any order:
File: [folder path]/[filename].html
To: [recipient email address]
Subject: [subject line for the outgoing email]
Example File line: HTML letters previously stored in NYGG S3 bucket/new_tech_employee_orientation_letter.html
Labels (File, To, Subject) are not case sensitive.
The folder path is relative to the Shared Documents library on the Geek Girls IT Team Site; the flow prepends this automatically, so only the subfolder and filename need to be typed.
Forward slashes are the expected separator between folder and filename. Backslashes are automatically converted to forward slashes by the flow if typed out of habit.Outgoing email is sent from noreply@geekgirlsit.com (shared mailbox). The account behind the Outlook "Send an email (V2)" connection must have Send As permission on this mailbox, granted in Exchange Admin Center.Flow logic: reads the trigger's bodyPreview, splits it into lines using decodeUriComponent('%0A') as the newline delimiter (a literal '\n' in the expression does not work, since Power Automate treats it as two literal characters rather than an actual line break), then filters for the line starting with each label and strips the label off.File retrieval: "Get file content using path" (SharePoint) with Infer Content Type enabled. Since the file is HTML (text), the action returns the content already decoded as plain text, not base64, so the Send an email Body field references the file content output directly with no base64ToString wrapper.Known limitation: if a submitted email happens to contain more than one line starting with the same label (for example, a signature block that also starts with "To:"), the flow uses whichever matching line appears first. Accepted as low risk given this is a low volume internal mailbox.
Error Handling
If "Get file content using path" fails, most commonly because the File path submitted does not exactly match the real SharePoint path (a stray space, typo, or wrong folder name), the flow does not just fail silently.
A parallel branch runs after "Get file content using path." One branch (the original) sends the HTML letter and only runs on the default "is successful" outcome. The other branch sends a failure notification and is configured, via that action's "..." menu > Run after (labeled "Configure run after" in some versions of the designer), to run on "has failed."The failure notification is sent back to the original sender of the trigger email (using the trigger's From field, triggerBody()?['from']), not to a fixed address, so whoever submitted the bad path is the one who finds out and can correct it.Both branches sit as siblings after "Get file content using path," added via that action's "+" icon and choosing "Add a parallel branch" (not the plain "Add an action" option), so only one of the two branches actually runs on any given execution.