Skip to main content
Inspiring
July 31, 2022
Answered

Formatting Emails sent from Captivate

  • July 31, 2022
  • 2 replies
  • 237 views

This community is great. I have spent hours learning Captivate from it. 

I want to use an email to send feedback on the eLearning course I have created. 

I found the basics at: Solved: Send an e-mail at the end of Captivate Project - Adobe Support Community - 8463641

I can collect the feedback in a text entry box, or a series of TEBs. 

But I'd like to format the email with at least a carriage return or two. I can't seem to get that past the encodeURI function. Here's what I've tried:

{
var who = window.cpAPIInterface.getVariableValue("cpInfoEmail");
var mySubject = encodeURI(window.cpAPIInterface.getVariableValue("cpInfoProjectName") + " Feedback");
var myText = encodeURI("My feedback is: " +"<br>");
var myBody =encodeURI(FeedbackTextEntryBox);

window.open("mailto:" + who + "?subject=" +mySubject + "&body=" + myText + myBody);
}

which very politely results in

"My feedback is: <br> " followed by the TEB text. No carriage return.

I've tried every variation of "\n" and "%0D", I can think of. Trying to use escape characters results in the code failing. Using encodeURIcomponent instead of encodeURI also fails, though it might be because of the wrong CR entry.

How can I get a plain carriage return into an email?

 

    This topic has been closed for replies.
    Correct answer bobs93071610

    I found something that worked. The mailto URL spec states that a CR must be %0D%0A in the body of an email. 

    I set a variable in Captivate 

    myCR = %0D%0A

     

    Then:

    var myBody1 =encodeURI(SomeText);
    var myBody2 = encodeURI(Text_Entry_Box_4);

    window.open("mailto:" + who + "?subject=" +mySubject + "&body=" + myBody1 + myCR + myBody2);

     

    Joy! It works.

     

     

    2 replies

    bobs93071610AuthorCorrect answer
    Inspiring
    August 1, 2022

    I found something that worked. The mailto URL spec states that a CR must be %0D%0A in the body of an email. 

    I set a variable in Captivate 

    myCR = %0D%0A

     

    Then:

    var myBody1 =encodeURI(SomeText);
    var myBody2 = encodeURI(Text_Entry_Box_4);

    window.open("mailto:" + who + "?subject=" +mySubject + "&body=" + myBody1 + myCR + myBody2);

     

    Joy! It works.

     

     

    Lilybiri
    Legend
    July 31, 2022
    Inspiring
    July 31, 2022

    Thank you. Plenty of inspiration, but no joy. It seems to me that Captivate and encodeURI don't play together well.