Explore the community Forums Lectora Lectora Questions & Answers 'Send Email' Action – Not populating fields correctly

Tagged: ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #360887 Score: 0
    Profile photo of Cam Phillips
    Cam Phillips
    Member
    beginner
    intermediate
    friend finder
    wise owl
    curious george
    contributor
    19 pts
    @_

    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.com&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!

    • This topic was modified 2 years, 2 months ago by Profile photo of Cam Phillips Cam Phillips. Reason: better title
    Attachments:
    #360926 Score: 1
    Profile photo of Stan Miller
    Stan Miller
    Member
    beginner
    intermediate
    LUC16 Attendee
    wise owl
    contributor
    curious george
    friend finder
    LUC17 Attendee
    35 pts
    @smiller7502

    Cam,

    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.

     

    This post has received 1 vote up.
    #360955 Score: 1
    Profile photo of Jason Dalrymple
    Jason Dalrymple
    Member
    beginner
    intermediate
    profile
    wise owl
    curious george
    contributor
    friend finder
    advanced
    picture perfect
    44 pts
    @JasonADal

    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 Feedback&cc=cc-email@state.mn.us”;

    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?

    This post has received 1 vote up.
    #360976 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

    Cam, your code worked fine for me too.

    This post has received 1 vote up.
    #361199 Score: 0
    Profile photo of Cam Phillips
    Cam Phillips
    Member
    beginner
    intermediate
    friend finder
    wise owl
    curious george
    contributor
    19 pts
    @_

    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!

    Cam

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.