Send Email Action

clammers
Community Member Posts: 133 ♪ Opening Act ♪
Can anyone assist me in replacing the Mail To action previously in Lectora? I have previously used this action in a few instances throughout several courses and now have to go back and update all of these. Scanning for forums, I found a post on creating the following javascript:
However, when I implement this, all I get is a white screen when I Run/Preview/Preview in Browser. Further, I need the ability to create several mailto actions: as there are multiple e-mail addresses throughout the course.
Any help is appreciated.
var email = “[email protected]”;
var subject = “My Notes”;
var body = Var_NoteSummary.getValue();
window.location.href = “mailto:” + email + “?subject=” + subject +”&body=” +body
However, when I implement this, all I get is a white screen when I Run/Preview/Preview in Browser. Further, I need the ability to create several mailto actions: as there are multiple e-mail addresses throughout the course.
Any help is appreciated.
Comments
-
Hi, Clammers. It looks like you found an old post of mine. Here it is working in version 18. If you have any problems or need something different let us know.
-
-
If you tried what I posted and it didn't work you are most likely doing something incorrect. I understand your frustration; I do most of my work from scratch without a delivery authoring tool as it gives me much more freedom to do whatever I want without bloated wonky code but this one is easily rectified.
This line window.location.href = 'mailto:[email protected]' will do exactly what you said you want to happen. If you copy and paste this into a run javascript action it will open the users email client with [email protected]inkins.com already in the To: address. Nothing else.
You are publishing to check, correct, not just using the built in preview? Also, the machine you are working on has an email client set up, right?
Let me know how it works. -
I agree with Bob - I just need something simple that will create a new email message (in the user's email client) with the address in the 'TO' field. In my situation, if I want to provide a list of e-mail addresses within the body text of a page, all I need is a hyperlink to 'MailTo' the given address. For example, "Please contact [email protected] for questions regarding this section of the training."
Darrel, the solution you provided works properly and is good for filling out a form; I have used something similar for other applications. However, it's more involved that what is needed (and what was offered previously in Lectora). -
Hi All, My solution was to go back to my Lectora Version 17 and then copy and paste into Lectora Version 18 any icons that had the send email action attached . This approach seems to work for me. I agree with Clammers a simpler solution within Lectora Version 18 would be better.
Cheers all! -
As Carmelo suggested (good suggestion by the way) here is a button library object from v17 with email action attached. Add to your library objects.
It is, however, advantageous to learn and use a little bit of JavaScript but I understand this is easier. -
Thanks, all. I've been copying-and-pasting the action from prior courses, so this is much easier. However, it doesn't solve the issue with in in-text hyperlinks. I can use this as a workaround, but <span style="text-decoration: underline;">please</span> Lectora, bring back this action.
-
Here's the email action on a block of text that is styled to look like an email link (underline and different color). Just add to your library then when you add it to your page change the text to match the address you put in the action.
-
I appreciate your help, but it's not working for me.
Using the "Send Email.awt" you sent I created a button on the page where you have the message box. I gave it the action OnMouseClick > Run JavaScript > window.location.href = ‘mailto:[email protected]'. Then published. The only thing that appears is a blank page. It doesn't matter which browser I view it in. I'm viewing locally, not served. -
Bob, do you have a mail client, like outlook, on that computer? If there is a mail client it should open up a new email with your address loaded in. Doesn't matter if it is on a server.
You can also try to import the email button object from my other post and then just drag it into a page and change the address in the action. To import the awo, you first save it (desktop works fine) and then open up your "my library" tab in Lectora. Double click the library objects folder and then add file. Browse to where you saved the awo and select it. Now you can drag it into any project and just change the address.
-
I have Outlook and it's open. I just published the "email button.awt" file as you sent it. The button shows but it nothing happens. That's the issue I found in the first place. The Send Email action shows since it was put in with an older version of Lectora, but Trivantis took out the code behind it, so it doesn't work any longer. It's very frustrating that they would do that.
-
-
-
I attempted to incorporate the library object, but when I change the recipient, reverts back to [email protected]
-
Clammers you are correct. I apologize. I did not test it beyond the first email. Here are two similar library objects that have the run JavaScript built in. Its pretty much the same as the other two I posted but will work properly. You'll just need to change the address just as you would have with the first ones.
-
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamHere is a title as a Lectora Online package file (which you can import to any Lectora) which has a JavaScript action to send email. It allows you to modify variables for the send to email, subject, cc, bcc, and body.
Should work great, please let me know if there is an issue with it. -
If we wanted to have the JS automatically put the subject into the email...could we?
This is how I used to do [email protected]?SUBJECT=CourseCode or Course Name
I currently have my button with an action to Run JS and in the window, I've put: window.location.href = "mailto:[email protected]";
The above works fine in ScormCloud, but if I try any variation to add the subject, I only see a white screen in ScormCloud.
Here are the variations I've tried:- window.location.href = "mailto:[email protected]";?SUBJECT=CourseCode
- window.location.href = "mailto:[email protected]"?SUBJECT=CourseCode
- window.location.href = "mailto:[email protected]";SUBJECT=CourseCode
-Chris -
Hi,
Question mark only after the email address and move the quotes to the end, like this:
window.location.href = “mailto:[email protected]?SUBJECT=CourseCode"
-
Hi Tim-
Thank you for your response, but I still think I'm missing something...I put the OnMouseClick Action of "Run JavaScript" and in the Target put “mailto:[email protected]?SUBJECT=CourseCode"
When I try to test it in ScormCloud, the page doesn't even show, I just see a white screen. If I remove the "SUBJECT=CourseCode" section, I can see it.
I've attached the page in case that might help.
Thoughts?
-Chris -
It still shows up a page of white.
-
The first quotation mark appears to be a smart quote. This can be easily noticed if you copy/paste into notepad or a similar text editor. If you have code that is inexplicably not working it's always a good idea to try this to identify an abnormality. See attached. Replace the first quotation mark with a standard one and you should be good.
Categories
- 35.8K All Categories
- 108 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products