How to add an email button with no CC address

This forum is for all Flare issues not related to any of the other categories.
Post Reply
John Cook
Propeller Head
Posts: 11
Joined: Wed Sep 09, 2015 2:25 pm

How to add an email button with no CC address

Post by John Cook »

I found this javascript in a MadCap turorial: https://docs.madcapsoftware.com/flare20 ... torial.pdf

And it contains this code:

function sendMail() {
var email=('myname@company.com');
var ccemail=('othername@company.com');
var subject="Feedback from topic: " + document.title;
var body="Feedback from topic: " + document.title + " (" +
window.location.href + ")";
var link = "mailto:" + email
+ "?cc=" + ccemail
+ "&subject=" + subject
+ "&body=" + body;
window.location.href = link;
}

Is it possible to modify this code so I don't include a CC address without breaking it?
Psider
Propellus Maximus
Posts: 902
Joined: Wed Jul 06, 2011 1:32 am

Re: How to add an email button with no CC address

Post by Psider »

I believe all you need to do is delete the whole ?cc line and then replace &subject with ?subject

You could also delete the 'var ccemail' line for tidiness but I don't think it would break anything to leave in.
SteveS
Senior Propellus Maximus
Posts: 2090
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: How to add an email button with no CC address

Post by SteveS »

I'd try:

Code: Select all

function sendMail() {
var email=('myname@company.com');
var subject="Feedback from topic: " + document.title;
var body="Feedback from topic: " + document.title + " (" +
window.location.href + ")";
var link = "mailto:" + email
+ "&subject=" + subject
+ "&body=" + body;
window.location.href = link;
}
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
John Cook
Propeller Head
Posts: 11
Joined: Wed Sep 09, 2015 2:25 pm

Re: How to add an email button with no CC address

Post by John Cook »

Psider wrote:I believe all you need to do is delete the whole ?cc line and then replace &subject with ?subject

You could also delete the 'var ccemail' line for tidiness but I don't think it would break anything to leave in.
That worked. Thanks so much!

John
Post Reply