2

Bit of an odd predicament. Some of the users of an interactive course I'm building will have the local Outlook application, and some will be using the Webmail version. I've managed to get the code working for passing variable values into the To, Subject, and Body fields for both, however, I'd like a way to get it to figure out which one the user has. And before you ask, yes every user will only have one or the other.

Sample here so you can see what I'm working with. This is the first of two, the second is nearly identical, except the mailto command and its counterparts are different for the Webmail application.

var LearnerEmail = window.cpAPIInterface.getVariableValue("LearnerEmail");
var TLemail = window.cpAPIInterface.getVariableValue("TLemail");
var subject = window.cpAPIInterface.getVariableValue("subject");
var EmailBody = window.cpAPIInterface.getVariableValue("EmailBody")
window.location.href = "mailto:" + LearnerEmail + "; " + TLemail + "?subject=" + subject + "&Body=" + EmailBody;

I'm fully aware that the browser does not have access to all of the local system's directory unless the user installs a custom extension of some kind (this problem isn't worth all of that work, however) so to my knowledge, there's no way to check the system for the

What I'm interested in is trying to open the local Outlook app first, then if nothing happens after a short delay, running the code the Webmail application instead. Is there a way to get javascript to verify that the mailto command went through or not, or a way to see if the system has successfully opened the application or not? If so, would it be possible to set up a function that will run the local command first, then switch to the other in a reliable way?

0 Answers0