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

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #316134 Score: 0
    Profile photo of Darrel Somoza
    Darrel Somoza
    Member
    contributor
    friend finder
    beginner
    intermediate
    junior moderator
    advanced
    wise owl
    curious george
    profile
    197 pts
    @Klaatu

    var email = “lisa.holscher@succeedms.com”;
    var subject = “My Email”;
    var body = Varvar_entry1.getValue();

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

    In your sample the entry text was being assigned to var_entry1. The above assigns that Lectora variable to the JavaScript variable body.

    Let em know if this works for you.

    Darrel

    Attachments:
    1. Test-Email.zip
    #317283 Score: 0
    Profile photo of Warren Zimmerman
    Warren Zimmerman
    Member
    beginner
    intermediate
    contributor
    wise owl
    @wzimmerman1834

    Thank you Darrel,

    That worked great. I really appreciate your willingness to help and point us in the right direction.

    Warren

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

    You’re welcome. Glad I was able to help. Anytime.

    #343845 Score: 0
    Profile photo of BrandiC
    BrandiC
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    Group Member
    contributor
    LUC17 Attendee
    1 pt
    @BrandiC

    Can anyone help me with a similar issue?

    I’ve set up my training to gather essay responses throughout the course and display them collectively at the end. I’d like to give them the option to email these responses to themselves or their manager. The above solutions don’t work because the email address is unknown. Is there a way for me to accomplish this?

    Thank you!

    #343901 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
    296 pts
    @timk

    You’ll need a way to get the email adress, e.g. an input field. Then modify Darrels script to use that instead of the static value:

    var email = VarEntry_0001.getValue();

    Entry_0001 is the variable of the input field. You may have to replace it in case you already have input fields in your course.

    #378946 Score: 0
    Profile photo of Nick Williams
    Nick Williams
    Member
    friend finder
    beginner
    intermediate
    contributor
    wise owl
    curious george
    advanced
    9 pts
    @nwilliams3743

    Is it possible to get each entry on a new line in the email?

    e.g. Throughout a module, a learner can add notes/questions in an entry field and add to the one variable. Once I follow the instructions in this thread, the values all appear on the one line.

    Does each note/question require it’s own variable to appear on a new line?

    Would essentially want it to look the same as Tim’s, however in an email

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

     

    Thanks

    • This reply was modified 1 year, 7 months ago by Profile photo of Nick Williams Nick Williams.
    #379615 Score: 0
    Profile photo of Nick Williams
    Nick Williams
    Member
    friend finder
    beginner
    intermediate
    contributor
    wise owl
    curious george
    advanced
    9 pts
    @nwilliams3743

    bump.

    Hoping someone can assist to have each entry added to a new line in the email?

    #379795 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
    296 pts
    @timk

    The sample uses only one variable for all notes. This should be better as you don’t know how many comments a user would create. To put each comment into a separate line you’ll have to add a break. In the sample I  use “\r” for breaks as Lectora doesn’t allow html tags. The change contents action replaces “\r” with “<br>”. For the email you can try to directly add “<br>” where you want to have a break or replace “\r” with “<br>” with javascript before you tranfer it to the “mailto:” command.

Viewing 8 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic.