';Send Email'; Action - Not populating fields correctly

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:

email1@domain.com?subject=Subject%20Line&cc=email2@domain.com&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:

email2@domain.comundefinedbody=

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!

emailfail.png

Discussion (5)

Cam,

I may be off base here, but in the email notification I got about your post your link showed undefined

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:recipient1@state.mn.us?subject=SSIS Essentials Feedbackundefinedbody=Enter some text here" - I'm wondering if the spaces between the values is throwing things off?

Cam, your code worked fine for me too.

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, &'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!

Cam

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.")

Discussions have been disabled for this post