javascriptemailpdfoutlooklivecycle-designer

How to get outlook to display only a link caption, not the whole link?


Inside a PDF file I set up a button for sending an email. It's a request email than should be approved or denied. I want the receiver to simply make 2 clicks in order to respond:

  1. Click on either "Approve" or "Deny" (a new email pops up)
  2. Click on "send" - Done!

This already works but the two links are a disaster: Received Mail How do I get Outlook to shorten the links (to "Approve" and "Deny" in this case) without doing anything in Outlook!?

Background:
The sender doesn't want to do anything in Outlook but press "send".
I'm inserting plain text from the PDF (see picture below), I'm already happy that Outlook manages to automatically convert that text to a clickable link. Before sending

I'm using Adobe LiveCycle Designer for my PDF email functionality, this is my code when the email button inside the PDF is clicked:

sendMail();

function sendMail(to, from, subject, body)
{
    to = (typeof to !== 'undefined') ? to : "test@test.de";
    from = (typeof to !== 'undefined') ? to : "test@test.de";
    subject = (typeof subject !== 'undefined') ? subject : "Request Mail";
    body = (typeof body !== 'undefined') ? body : "Hello,\n\n please approve this request!\n\n";

    var subjectOk = "Request approved";
    var subjectNo = "Request denied";
    var responseOk = "Your request has been approved.";
    var responseNo = "Your request has been denied.";
    var linkOk = "<mailto:" + from + "?subject=" + subjectOk + "&body=" + responseOk + ":>";
    var linkNo = "<mailto:" + from + "?subject=" + subjectNo + "&body=" + responseNo + ":>";
    var links = linkOk + "\n" + linkNo;

    event.target.app.mailMsg(
            {
                bUI: true,
                cTo: to,
                cSubject: subject,
                cMsg: body + links
            }
    );
}

Is there any JS function to convert my strings to a format that outlook will recognize immediately? I'm quite impressed that even though the email format is "nur Text" - which I guess is "plain text" Outlook still displays clickable links after sending the email. I just hope I can find a way to hide those full links somehow.


Solution

  • This is what you gonna get if you use plainText body type. Nothing you can do. To display user friendly titles you need to use HTML, which as far as I see not supported by AcroForms.