What's the TiddlyWay to URI-encode and URI-decode strings for use in macros? I know there's a filter now that do some of that, but what I'd like is the ability to pass in a string via a macro and get back the URI-encoded version, which I could use to set variables to use in building a "mailto:" string.
For example, I have different tiddlers with different (short!) e-mail form-letter skeletons. I want my macro to be able to grab the body of one, URI-encode it, and assemble a URL like:
mailto:jd...@coolexample.com?subject=One%20of%20Several%20Possible%20Subject%20Lines&body=That%20whole%20tiddler%body%from%the%20other%20tiddler%2E
Will I have to venture into the land of JavaScript modules for that?
title: template
Subject: {{!!subject}}
mailto: {{!!to}}
message: When in the course of human events,
it becomes necessary for one people to dissolve
subject: Self evident truths
title: encode example
to: dtrump@whitehouse.gov
<$wikify name="missive" text="{{||template}}" >
<$list filter="[<missive>] +[encodeuri[]]">
<<currentTiddler>>
</$list>
<$wikify>
Subject:%20Self%20evident%20truths%20%0Amailto:%20dtrump@whitehouse.gov%0Amessage:%20When%20in%20the%20course%20of%20human%20events,%0Ait%20becomes%20necessary%20for%20one%20people%20to%20dissolve%0A
Have you taken this all the way to a mailto: link and can you populate the body of the email. I keep hitting buggy walls when I try.
Further I wonder if it could be possible to add an attachment like a tiddler or json file.
I see this as a way for people to contribute content from a modified read only or noteself wiki.
Grasping for straws to make this work.
Regards
Tony
Cheers,
Thomas
Hi, $(recipient)$ —
Your package has shipped.Included:$(list of items)$$(user's personalized message to the recipient)$You can track this package online at the $(carrier)$ Web site. Here's a link:$(tracking link)$$(user's signature)$
There needs to be some step to pass it to the browser to invoke email. Encoding is only step 1.
A long time ago Riz & Thomas Elmiger did a bunch of work on this (for me [i'm feeling guilty still for that effort by them that I could not reciprocate]) that works well. I could maybe give more detail if I know its worth the effort for me to dig the details out.