'Send Email' Action - Not populating fields correctly

_ Community Member Posts: 84
Hi Folks,

I'm trying to send an email from within Lectora (with the sender, CC, subject line and body prepopulated) but I can't get it working correctly.

The code I'm using on the 'Send Email' action is as follows:

[email protected]?subject=Subject%20Line&[email protected]&body=Body%20text%20goes%20here

The 'send-to' address and subject line populate correctly, however I get the following dumped into the body of my email:

[email protected]&body=Body text goes here?subject= &body=

See also in attached screenshot. *scratches head*

Can anyone see where I'm going wrong here? I feel like I'm missing something simple... I thought the 'Send Email' function was essentially the same as a HTML mailto?

Thanks in advance for any tips!


  • smiller7502
    smiller7502 Community Member Posts: 181

    I may be off base here, but in the email notification I got about your post your link showed & in two places. In the post itself it just shows &, so this could just be an artifact of how Trivantis emails posts -- but just in case, make sure the link you're actually using just has &, not &

    The link as posted here works correctly for me, so I'm afraid I don't have anything else to offer, sorry.

  • jasonadal
    jasonadal Community Member Posts: 441 ♪ Opening Act ♪
    If it helps, I have a button in one of my courses that uses a RunJS based on a topic I found from several months back. The email message correctly populates the email, a cc recipient, and subject, but I haven't taken it to the point of adding any body text.

    Based on the code I'm using, this might help you out:
    window.location.href = "mailto:[email protected]?subject=SSIS Essentials Feedback&[email protected]";
    From there, I think you could just add "&body=Enter some text here" - I'm wondering if the spaces between the values is throwing things off?
  • klaatu
    klaatu Community Member Posts: 988
    Cam, your code worked fine for me too.
  • _
    _ Community Member Posts: 84
    Hi Folks,

    Thanks for taking a look - I managed to get it working!

    As you mentioned there was nothing wrong with the code on the 'Send Email' function - it was behaving strangely in Preview mode, but when published and deployed to an LMS it works well and populates the fields correctly.

    I also did some other tweaks to page-level custom JavaScript which may have been interfering.

    @smiller7502 - Yep, looks like the email simply mangling the code, &amp's in there definitely would've caused issues
    @JasonADal - It doesn't seem like the spaces cause issues, Lectora swaps these out for %20 spaces when published
    @Klaatu - Thanks for taking a look Darrel!

    Cheers everyone!

  • deater6512
    deater6512 Community Member Posts: 2
    I am using Lectora 17 and I have been trying to use the following code to send an email that contains resources from a course where the learner will self-populate their email address. The learner can then access the email for reference at a later time. The email function works when I test it locally and functions in production on the desktop. When I try to generate the email on a mobile device there is no response. Any ideas?

    window.open("mailto:?subject=Resources&body=Subject goes here. Link to resources goes here.")