Explore the community Forums Lectora Lectora Questions & Answers Send text from Lectora to an email or print friendly page

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #283629 Score: 0
    Profile photo of Knorberg
    Knorberg
    Member
    beginner
    intermediate
    friend finder
    curious george
    @Knorberg

    Hi,
    can anyone help me with my issue on sending text from Lectora to email/print friendly page.

    I’m developing a course with a note book functionality (like the functionality from the lets’ cook course), and what I want is for the learner to collect, save, print or email a summary of his/her notes in the course.

    What I have tried to do:
    Every time the learner click an add note button, the text from the free text field is added to a variable.
    A summary of all texts is shown in a Note summary page.
    Then I would like to print or send this text by email. The Print functionality in Lectora is only printing a screen dump, and miss out the text witch is “hidden” behind the scroll bar.
    When sending the variable to an email, it doesn’t look nice, without any line breaks.
    Do I need to use JavaScript, which I know nothing about, or is there an other solution?
    I appreciate any suggestions to solve this.

    Kristine

    #303382 Score: 0
    Profile photo of Carlos Ruiz
    Carlos Ruiz
    Member
    beginner
    intermediate
    friend finder
    @CarlosRu1z

    Did anyone find a solution to this issue?

    I have a very similar problem. I’m showing a summary of what was offered in the content, and I need to send this text as an email body by pressing a button on the same screen.

    Please, any suggestions to solve this?

    Thanks in advance,

    Carlos

    #303388 Score: 1
    Profile photo of Jennifer Valley
    Jennifer Valley
    Member
    contributor
    beginner
    friend finder
    advanced
    lectora beginner
    verified member
    wise owl
    profile
    picture perfect
    curious george
    114 pts
    @jvalley4735

    This sounds like something you’d need to achieve using some additional scripting. I’ll ask a couple people to see if they have suggestions.

    This post has received 1 vote up.
    #303395 Score: 0
    Profile photo of Carlos Ruiz
    Carlos Ruiz
    Member
    beginner
    intermediate
    friend finder
    @CarlosRu1z

    Many thanks Jennifer, I also think I need scripting added to the button but my javascript knowledge is very limited, so I would be grateful for any help.

    As a b-plan, I’ve found a script to select and copy the text (and manually paste it in the email body), but haven’t been able to make it run.

    #303441 Score: 1
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    199 pts
    @Klaatu

    Create a button and add the following Javascript:

    var email = “someone@someplace.com”;
    var subject = “My Notes”;
    var body = Var_NoteSummary.getValue();

    window.location.href = “mailto:” + email + “?subject=” + subject +”&body=” +body

    Replace “someone@someplace.com” with the email address you want the information sent to. Replace Var_NoteSummary with whatever lectora variable you have been using to record the notes.

    As info, since you mentioned the Let’s Cook sample, I used that to test. _NoteSummary is the variable that holds all the saved notes. If you add a button in the header of the notes object found in popups with the code above, it will open email with the notes summary in the body.

    Of course for this to work the user must have a default email client set up on their computer.

    Hope this helps. Contact me if you have any questions.

    Darrel

    NOTE: If you copy and paste right from this forum you may need to delete and re-add the quotes. For some reason copied quotes are sometimes a problem.

     

    This post has received 1 vote up.
    #305636 Score: 0
    Profile photo of Carlos Ruiz
    Carlos Ruiz
    Member
    beginner
    intermediate
    friend finder
    @CarlosRu1z

    Thank you very much for your help. I tested the solution described above and worked perfectly, but I have only one last goal to achieve.

    My question is, as an evolution of the saved notes solution, how could I make a variable hold a summary text (whick is shown in the last page of the content), in order to send the variable content as an email body when pressing the button?

    Thanks in advance,

    Carlos

    #305638 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    313 pts
    @timk

    Can you elaborate on your question? The way I understand it, that is exactly what Darrel’s script is doing. You can use the variable “_NoteSummary” to display the summary in a textfield as well as using it as the email body.

    Tim

    #310113 Score: 0
    Profile photo of Knorberg
    Knorberg
    Member
    beginner
    intermediate
    friend finder
    curious george
    @Knorberg

    Thank you:-)

    If I want a printerfriedly page of the content of the _notesummary variable, do you have any tip regarding script?

    Thank you in advance.

    #310126 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    313 pts
    @timk

    A printerfriendly page would just be an otherwise empty page with only a textfield that contains the variable. You can create a page, put a textfield on it and attach an action to it:

    On: Page show
    Action: Change content
    Target: This object
    Value: _notesummary

    Check the course I’ve shared:

    https://community.trivantis.com/shared-content/breaks-in-variables/

    Tim

    #310151 Score: 0
    Profile photo of Knorberg
    Knorberg
    Member
    beginner
    intermediate
    friend finder
    curious george
    @Knorberg

    Thank you so much for shareing:-)

    K

    #315877 Score: 0
    Profile photo of Warren Zimmerman
    Warren Zimmerman
    Member
    beginner
    intermediate
    contributor
    wise owl
    @wzimmerman1834

    Hello Darrel,

    Your post was very exciting when I first saw it, but now that I’m attempting to implement it, it’s not working at all.

    I’ve even scaled back to just the most basic javascript not using any variables at all, and it won’t open a simple mailto: link. I’m using lectora 11. Screenshots of my setup are attached.

    This script:

    window.location.href=”mailto:myemail@mycompany.com”;

    Added to a button as a “Run Javascript” action on the button, but nothing is happening. I must be missing a checkbox somewhere? This should be very trivial. I’m testing as a tincan export in scorm cloud and the course is passing and completing, but the javascript refuses to work?

    #315880 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    199 pts
    @Klaatu

    Hi Warren. Sorry to hear your having difficulties. Try the attached and let me know if you get a better result. If you copy and pasted directly from this forum you need to change the quotation marks.

    Darrel

    Attachments:
    1. Mailto.zip
    #315921 Score: 0
    Profile photo of Warren Zimmerman
    Warren Zimmerman
    Member
    beginner
    intermediate
    contributor
    wise owl
    @wzimmerman1834

    Hello Darrel,

    Thank you so much for your quick response. So the mailto link is working, but once we add a variable and try to concatenate the javascript string it stops working.

    So very cool we can populate a subject and body hard coded into that script, This is working just as you mentioned:

    window.location.href = “mailto:myname@mycompany.com?subject=email test&body=stuff the user wrote.”;

    But once we try to grab the contents of the text field like this:

    var body = Var_NoteSummary.getValue();

    window.location.href = “mailto:myname@mycompany.com?subject=email test&body=” + body;

    It just stops working all together. That variable is making the mailto: link not activate.

    Any idea where we’re dropping the ball here? Seems like it should be very straight-forward.

    Thank you,

    Warren Zimmerman

    #315922 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    199 pts
    @Klaatu

    It might be easier if you can either post a sample of what you have, or if you prefer, you can email me at darrel.somoza@elearningcode.com and I will take a look.

    #316119 Score: 0
    Profile photo of Warren Zimmerman
    Warren Zimmerman
    Member
    beginner
    intermediate
    contributor
    wise owl
    @wzimmerman1834

    Hello Darrel,

    I’ve attached a zip file with our Lectora attempt included.

    I’m wondering if we need to create the mailto: string before the actual href call? Not sure, but once we add the variables to the mailto link it just stops working.

    Warren

Viewing 15 posts - 1 through 15 (of 23 total)

You must be logged in to reply to this topic.