Fun with Mac OS mail links

Forgive me if this is general knowledge but…
My mail workflow on my main gig is, with a new contract and new work email, I make a DT database that’s just the work email account, archived. This works very well. I can grab links to DT imported emails and put them in docs in the working database for that project. This way I also have a back up of all my email should the current employer botch their whole email setup or decide to switch to a new provider or platform or whatever. (ask me how I know this might happen)
Recently though I came across a Shortcut for getting links to MacOS mail messages. This has speeded up some uses I have for email links. I don’t have to import all the days mail and then find the link to the message I want in DT, I can just run the Shortcut and paste the link into the DT doc I am using to track the issue. Very handy. It’s weird that Apple makes you use a Shortcut with AppleScript to find the link to a message in their own app but whatever.
Today though I discovered that the links to the MacOS mail message and the same message when imported into DT are basically the same data just with a different prefix. That means I can grab the mail link on the fly and put it where ever I want and then later, change the prefix (message://) to (x-devonthink-item://) and it will link to the DT archived version instead of the Mail message which I might not have in the distant future.
This is very cool.
I am not looking forward to the Sonoma upgrade when the simplicity of the Archive Mail step goes away but I hope this link similarity is still available.

Indeed as an email’s UUID is derived from the message id from Mail.