name:recipient
text:the text to sendHi <<the_recipient>>!
Thisisyour text: <<the_text>>.
Regards<$set name="the_recipient" tiddler="data" index="name">
<$set name="the_text" tiddler="data" index="text">
<pre>
{{MailText}}
</pre>
</$set>
</$set>
<$set name="the_recipient" tiddler="data" index="name">
<$set name="the_text" tiddler="data" index="text">
<$list filter="[[MailText]get[text]encodeuri[]]">
<<currentTiddler>>
</$list>
</$set>
</$set>Hi%20%3C%3Cthe_recipient%3E%3E!%0A%0AThis%20is%20your%20text:%20%3C%3Cthe_text%3E%3E.%0A%0ARegardsHi%20recipien!%0A%0AThis%20is%20your%20text:%20the%20text%20to%20send.%0A%0ARegardsHey there's a familiar name! Welcome back Stephan.
I think you need to wikify the MailText (wikifywidget) before sending to encodeuri
Stephen,Welcome back, if you can share your ultimate result that would be great.
<$set … define your variables>
{{Mailtemplate Tiddler -- Linktext||mailto}}
</$set>Hi Team.
Please be informed that I've created. Customer <<Customername>>.
Best Regards,
Customername: <$edit tiddler="Customerdata" index="name"/>
<$set name="Customername" tiddler="Customerdata" index="name">
{{Mailtemplate Customer ready -- Inform the team||mailto}}
</$set>\define mailto()<a href="mailto:$(recipients_encoded)$?subject=$(subject_encoded)$&body=$(body_encoded)$">$(linktext)$</a>\end
<!-- separator used between tiddler and linktext --><$set value=" -- " name="sep">
<!-- extract the tiddler's title--><$set select="0" filter="[all[current]splitbefore<sep>removesuffix<sep>]" name="tiddler">
<!-- extract the linktext --><$set select="0" filter="[all[current]removeprefix<tiddler>removeprefix<sep>]" name="linktext">
<!-- get the mail template's text --><$set tiddler=<<tiddler>> field="text" name="body">
<!-- get the subject from the subject field --><$set tiddler=<<tiddler>> field="subject" name="subject">
<!-- get the recipients from the recipients field --><$set tiddler=<<tiddler>> field="recipients" name="recipients">
<!-- wikify the text to resolve all used variables --><$wikify text=<<body>> name="body_text">
<!-- wikify the subject to resolve all used variables --><$wikify text=<<subject>> name="subject_text">
<!-- wikify the recipients to resolve all used variables --><$wikify text=<<recipients>> name="recipients_text">
<!-- encode the text --><$set select="0" filter="[<body_text>encodeuri[]]" name="body_encoded">
<!-- encode the subject --><$set select="0" filter="[<subject_text>encodeuri[]]" name="subject_encoded">
<!-- encode the recipients --><$set select="0" filter="[<recipients_text>encodeuri[]]" name="recipients_encoded">
<!-- create the link --><<mailto>>
</$set>
</$set>
</$set>
</$wikify>
</$wikify>
</$wikify>
</$set>
</$set>
</$set>
</$set>
</$set>
</$set>I will have play with this. I have tried similar things but always find using mailto fragile, it seems to break at a whim.
I expect as a result my dreams of adding attachments or using rich html emails is but a pipe dream.
Regards
Tony