Hey Troy,
I’ve done a little experimenting with AppleScripting a draft in Mail.app.
It looks to me like your task can be accomplished by:
A) Manually saving a draft email template.
B) Doing some search/replace on the template’s actual .emlx file.
C) Copying the draft template into the Drafts mailbox.
D) Opening it.
E) Sending it.
A bit complicated to set up but doable.
Probably the better option is to create your message on-the-fly with AppleScriptObjC.
--------------------------------------------------------------------------------
# Auth: Christopher Stone (Heavy Lifting by Shane Stanley)
# dCre: 2013/12/04 22:27 +1100
# dMod: 2016/11/16 19:01 -0600
# Appl: Mail.app
# Task: Create new styled-text email.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @ASObjC, @Create, @Styled-@Text, @Email
--------------------------------------------------------------------------------
use framework "Foundation"
use framework "WebKit"
use scripting additions
--------------------------------------------------------------------------------
set theSource to "<html><body><H2>Your Wish is My Command...</H2><br><a href=\"http://www.macosxautomation.com/applescript/apps/\">Good stuff here</a></body></html>"
set theSource to current application's NSString's stringWithString:theSource
set theData to theSource's dataUsingEncoding:(current application's NSUTF8StringEncoding)
set theStyledText to current application's NSAttributedString's alloc()'s initWithHTML:theData documentAttributes:(missing value)
set mailShare to current application's NSSharingService's sharingServiceNamed:(current application's NSSharingServiceNameComposeEmail)
mailShare's setRecipients:{"s.claus@north.pole.com"}
mailShare's setSubject:"I Wish Styled-Text Emails Could be Scripted in Mail.app!"
mailShare's performWithItems:{theStyledText}
--------------------------------------------------------------------------------
You can also include attachments, although I’d have to ask Shane how to do it.
Run from an Execute an AppleScript action.
-Chris