Turn a tiddler into an email

26 views
Skip to first unread message

Ralphish

unread,
Jun 16, 2007, 7:15:10 AM6/16/07
to TiddlyWiki
I'm looking for a way to turn a tiddler into an email, where the
subject is the tiddler title and the body is the text of the tiddler.
Ideally this would be an option on the tiddler's toolbar.

There was some discussion in this group previously around this issue
(in the thread "Help: turning plugin macro into toolbar item,
MailTiddler" which indicated some success, but I have not been able to
turn this into a workable plugin or macro.

We run a phone-in helpline and I have set up a guerilla TW for my team
to help in responding to questions. At this time it not possible to
put this info on the web, so I want to be able to click an "email"
button, see the tiddler appear in my default mail client, fill in the
email address and send.

I am very new to TW and really have no idea what I'm doing with CSS.
Any help would be appreciated.

Saq Imtiaz

unread,
Jun 16, 2007, 8:13:33 AM6/16/07
to Tiddl...@googlegroups.com
I have worked on this in the past, but ran into various problems.
The decisive factor may be, what mail application do you need to get it to work with?
( an implementation that supports ALL applicatons, including web mail, is quite difficult to implement)
Saq
--
TiddlyThemes.com ( http://tiddlythemes.com ) : a gallery of TiddlyWiki themes.
TiddlySnip ( http://tiddlysnip.com ) : a firefox extension that turns TiddlyWiki into a scrapbook!
LewcidTW ( http://tw.lewcid.org ) : a repository of extensions for TiddlyWiki

Rick Magers

unread,
Jun 16, 2007, 11:07:05 AM6/16/07
to TiddlyWiki
Ralphish,

This has limitations but might work for you. It should work with any
email client on you computer but don't know about webmail. mailto: has
a limitation of 200 characters (I think) in the body.

1. Create tiddler called EmailTiddler with this content and tag it
systemConfig:

//{{{
config.macros.email = {};
config.macros.email.handler =
function(place,macroName,params,wikifier,paramString,tiddler){

wikify('[[email|mailto:?subject='+escape(tiddler.title)
+'&body='+escape(tiddler.text)+']]',place);
place.lastChild.className='button';
place.lastChild.title='Email this
tiddler';
}
//}}}

2. Modify this line in your ViewTemplate tiddler to include the <span
macro='email'></span> portion:

<div class='toolbar'>
<span macro='toolbar newHere +editTiddler deleteTiddler permalink
references jump closeOthers -closeTiddler'><span macro='email'></
span></div>

3. Save and reload.

Rick

Damian & Steph Bariexca

unread,
Jun 16, 2007, 3:25:47 PM6/16/07
to Tiddl...@googlegroups.com
Rick,

Thanks for this code - I'm trying to implement it on my site, but I keep getting a plugin manager error message: "SyntaxError: missing : after property id".  I know nothing about programming, and my attempts at Googling a solution have left me more confused than when I started - any suggestions?

Thanks again,
Damian

dotCdot

unread,
Jun 16, 2007, 5:15:57 PM6/16/07
to TiddlyWiki
at this thread (c/o Brian Burnham):

http://groups.google.com/group/TiddlyWiki/browse_thread/thread/1d1ff44bb2f32958/fd0b64c34ed87e52#fd0b64c34ed87e52

you will find this macro:

//{{{
config.macros._mail = {};
config.macros._mail.handler = function
(place,macroName,params,wikifier,paramString,tiddler) {

wikify("<html><a href=\"mailto:?subject=" + tiddler.title +
"&body=" + tiddler.text.htmlEncode() + "\">mail</a></html>", place);
}
//}}}

put <<_mail>> in the body of the tiddler & it will create a mail
(unfortunately, with the carriage returns stripped out)

..c..

HeX

unread,
Jun 18, 2007, 3:12:30 AM6/18/07
to TiddlyWiki
Hi Damian & Steph,

I had the same problem but found the solution. When copying the code
from Rick and creating that systemConfig tiddler there are some html-
linebreaks about which TiddlyWiki complains (so it's actually a copy/
paste problem). Simply go to that tidller and remove all blank lines
with the del-key and than insert them again with the return-key. After
that save and reload and it should work (well it did on my
TiddlyWiki).

/HeX

when copying the

On Jun 16, 9:25 pm, "Damian & Steph Bariexca" <barie...@gmail.com>
wrote:


> Rick,
>
> Thanks for this code - I'm trying to implement it on my site, but I keep
> getting a plugin manager error message: "SyntaxError: missing : after
> property id". I know nothing about programming, and my attempts at Googling
> a solution have left me more confused than when I started - any suggestions?
>
> Thanks again,
> Damian
>

Message has been deleted

HeX

unread,
Jun 18, 2007, 3:34:57 AM6/18/07
to TiddlyWiki
Hello,

is there a way to get the encoding for German umlauts like öäüß
correctly rendered by "tiddler.text.htmlEncode()" ? Also when I've got
a heading which starts with the dewikifier "~" the macro goes
silly...i.e.:
"!~TestHeading" gets rendered as "!???????????????????"

Thanks,
/HeX

On Jun 16, 11:15 pm, dotCdot <ilin...@gmail.com> wrote:
> at this thread (c/o Brian Burnham):
>

> http://groups.google.com/group/TiddlyWiki/browse_thread/thread/1d1ff4...

Damian & Steph Bariexca

unread,
Jun 18, 2007, 6:36:29 PM6/18/07
to Tiddl...@googlegroups.com

Nice one, Hex; thanks very much.  Works a treat now.

--Damian

FND

unread,
Jun 19, 2007, 3:59:36 PM6/19/07
to Tiddl...@googlegroups.com
> 2. Modify this line in your ViewTemplate tiddler to include the <span
> macro='email'></span> portion:

Why the extra span? Why not just add the "email" part to the other
macros in the tiddler toolbar?

btw: This only works on relatively small tiddlers - but that's probably
to do with the previously-mentioned limit for the body part. (Or there's
a general 256 chars limit, as is the case with URLs IIRC.)

Nevertheless, good job on this!


-- F.

HeX

unread,
Jun 20, 2007, 2:35:15 AM6/20/07
to TiddlyWiki
Hmm I tried adding just "email" to the macros tiddler toolbar line but
that had no effect. I.e. no button was visible. I had actually to
include the whole span part aswell in order to get the email button
show up. Strange...

/HeX

PS: Nobody out there who has a solution to the "alien" character
problem?

Simon Baird

unread,
Jun 20, 2007, 3:38:01 AM6/20/07
to Tiddl...@googlegroups.com
The toolbar contains things called "commands". See config.commands in the core code. These are different to macros and can only be used in the toolbar. So that's why.


On 6/20/07, HeX <HeX.i...@googlemail.com> wrote:

Hmm I tried adding just "email" to the macros tiddler toolbar line but
that had no effect. I.e. no button was visible. I had actually to
include the whole span part aswell in order to get the email button
show up. Strange...



--
simon...@gmail.com

HeX

unread,
Jun 20, 2007, 10:16:27 AM6/20/07
to TiddlyWiki
> The toolbar contains things called "commands". See config.commands in the
> core code. These are different to macros and can only be used in the
> toolbar. So that's why.

Thank you for the clarification Simon.
/HeX

FND

unread,
Jul 5, 2007, 3:46:19 PM7/5/07
to Tiddl...@googlegroups.com
> This has limitations but might work for you.

HeX and I have made some modifications to make this work with a number
of special chars (umlauts, currency symbols etc.).
You can find the macro here:
http://devpad.tiddlyspot.com/#eMailMacro
(I hope I got the author attributions right - please let me know if
there are any corrections to be made.)


-- F.

Reply all
Reply to author
Forward
0 new messages