Hello Ken,
On Tuesday, December 31, 2002 at 8:37 AM, a witness saw Ken & Marilyn
[KM] type:
KM> register_a_friend: Register A Friend
KM> friends_name: Patti
KM> friends_email: [EMAIL PROTECTED]
KM> your_name: Sunny
KM> your_email_address: [EMAIL PROTECTED]
KM> Submit: Submit
KM> What I want is a Quick Template that puts the "friends_email" into the
KM> TO: box, the "friends_name" in the body after Hi ***** and the
KM> referrers name "your_name" in the body.
You need regular expressions. They aren't hard, but they do have a
steep learning curve.
To extract the friend's name, use:
%RegExpText="(?im-s)^\s*friends_name:\s*(.*?)\s*\n"%-
Simillarly, friends_email can be retrieved with:
%RegExpText="(?im-s)^\s*friends_email:\s*(.*?)\s*\n"%-
And for your_name:
%RegExpText="(?im-s)^\s*your_name:\s*(.*?)\s*\n"%-
KM> It should look something like this.
<snip>
So your final template would look something like:
=====[Begin Template]=====
Hi %RegExpText="(?im-s)^\s*friends_name:\s*(.*?)\s*\n",
A friend of yours, %RegExpText="(?im-s)^\s*your_name:\s*(.*?)\s*\n",
thought you'd like to receive our newsletter...
%To=''%To='%RegExpText="(?im-s)^\s*friends_email:\s*(.*?)\s*\n"'
=====[ End Template]=====
Note: If you are in the process of learning regular expressions and
how to use them in TB, I've used a shortcut with the %RegexpText
macro. The expressions above are fairly simple, so such
shorcuts are justified.
--
Thanks for writing,
Januk Aggarwal
With these words, this page is no longer blank but is complete.
________________________________________________________
Current version is 1.61 | "Using TBTECH" information:
http://www.silverstones.com/thebat/TBUDLInfo.html