Help - Search - Members - Calendar
Full Version: Passing MT title to mail form
Movable Type Community Forum > Additional Resources > Tips and Tricks
Titanium
Hey y'all

At the bottom of each entry I have a mail icon which takes the visitor to a mail form for comments.  I was wondering if their was a way to pass the title <$MTEntryTitle$> of the post on to the mail form.  For example, when someone clicks the mail icon in an entry entitled "rootbeer" they will get the mail form with the subject prefilled "re: rootbeer"

Thanks
medic119
I assume you are using a mailto tag?

Try
CODE
<a href="mailto://you@you.com" subject="<$MTEntryTitle$>">E-mail</a>


You can also add a body tag after the subject to fill in the body of the e-mail by default.  Example:
CODE
<a href="mailto://you@you.com" subject="<$MTEntryTitle$>" body="<$MTEntryExcerpt$>">E-mail</a>
maddy
Is the html for the mail form included on the archive page along with the entry, or are visitors being sent to the same page with a mail form, regardless of which entry they click through from?
Titanium
QUOTE
Is the html for the mail form included on the archive page along with the entry, or are visitors being sent to the same page with a mail form, regardless of which entry they click through from?

Thanks for your reply medic119.  No, I'm not using a mailto link but a mail form.

Thanks to you as well Maddy.  Visitors are being sent to a separate page (contact.html) which is a form.  The email link embedded into each posting points to contact.html.

I am familiar with the mailto way of filling out a subject line.  I'm trying to do basically the same thing, just with a form.
kadyellebee
Have you already looked at the Mail This Entry script that's already built into MT?  If it won't work for you, you might be able to modify its code to help you.  Maybe also the popup version would be workable.


Kristine
oscarf
Maybe you can cook something up with a simple javascript you could adapt from this example ...
medic119
Oh. Sorry.  Must have mis-read the post earlier.

Would something like this work?
CODE
<input name="subject" size="20" value="<$MTEntryTitle$>"/>
Titanium
Thanks for replying kadyellebee and oscarf.  The pop-up looks very promising.  In fact, it's a better solution than what I was originally trying to do.

I'm just starting to play with it now.

Thanks to all of you!!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.