Adding Action To Send Email
October 9, 2017 12:00 AM
I have a project that requires a notification go to an individual based on which option is chosen on a test question. There is an action that allows me to say "On Select/Change" - "Send Email" and then there is a box to enter the email address in. Is there a way to put a subject line on the email? And, what is the best way to identify who sent it? (i.e. will CourseMill include that automatically somehow or do I need to have them enter their name in a survey question or something?
Discussion (7)
Hi Rhonda,
I do this with a feedback option in one of my courses so that it sends to multiple individuals and has a default subject line. I use a RunJS on a button on the final page of the course with the following:
window.location.href = "mailto:undefined attaches each additional parameter.Hope this helps!
That's correct - you can copy and paste the text in my post into the RunJS box and replace the "undefined" etc. without the brackets. Just make sure to re-do the quotation marks, though - if you leave them as is, it doesn't work.
If you want, I can post a page with a sample a little later so you can see how it all fits together and behaves.
Hi Jason! Thanks for quick feedback.
I'm assuming you put the JS directly in the empty white box? I have a full string of it written already that I had used in a separate situation and I hadn't thought of actually putting it directly into Lectora. I'll try that see what happens. Thanks so much!
undefined
Not a problem! It was really just a matter of copy/pasting into a new title and removing some elements that would have borked up the page. Keep in mind that this should open the user's default email client and may throw out a warning. The warning is asking if the user wants the web page to allow access to the program. There's no way around this and is entirely dependent on the user's browser settings. You may want to consider adding that information to the page just in case.
(You get a bonus function on this page of an animated character changing poses that is not part of the default character set in Lectora.)
A sample of that would be tremendously helpful. I don't want to impose but if you have time, I'd greatly appreciate it. Thanks you!
If you need to build in this functionality without engaging the clients email application you can use PHP. PHPMailer is an awesome free script.
Jason, the example worked like a charm! I was able to put the body text that I wanted and everything. Thank you so much for sharing that and saving me hours of trying to figure it out. I feel accomplished for today :) BTW, your looping character was a cool bonus that I'll find a place for.
Darrel, thanks for your input. I'm not very familiar with PHP code and it appears that I've got this situation fixed for now but I'll keep this in mind and reach back out to you if something comes up that I want to dive into that. You guys are all lifesavers!
undefined
Discussions have been disabled for this post