• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

modifying VanWeelden's email button script to not include topic info?

Explorer ,
Sep 05, 2014 Sep 05, 2014

Copy link to clipboard

Copied

I'm using William Van Weelden's JavaScript to put a button on my WebHelp skin that will open the user's email program (Outlook) and populate with our email address.  We do not need anything in the subject line, CC line, BCC line, or in the Body.  We do not need any of the topic information.  When I try to take out just the references to the topic, either the whole script stops working for the other functions I'm using from his script, or RH freezes.  I'm using RH11 with XP Blue skin, and his JavaScript is in the right place in my Baggage files.  What modification(s) do I need to make?  Thanks, and thanks William

Here's the text of his JS:

function Email() {//Create an email with the link to the current topic.

var url = GetRelTopicURL();
var title = GetTopicTitle();

var emailaddress = "test@example.com";
var message = ""; //Custom message
 
var mail = "mailto:"+emailaddress+"&subject="+title+"&body="+message+"\n"+title+": "+escape(url);

var body = document.getElementsByTagName("body")[0];

var a = document.createElement('a');
  a.setAttribute('href', mail);
  a.setAttribute('style', 'display: none');

body.appendChild(a);
a.click();

Views

202

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 08, 2014 Sep 08, 2014

Copy link to clipboard

Copied

LATEST

If you replace the var mail line with the following, you should be fine:

var mail = "mailto:"+emailaddress;

Kind regards,

Willam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp