How to automatically set a message into submit ticket form on customer portal from URL parameter

If you want to pre-fill name, email and even message on your 'submit ticket' form on customer portal, you can use a link like this >>>

https://ACCOUNT.ladesk.com/submit_ticket?name=Customer&email=customer@email.com&message=Example%20text

The customer portal doesn’t pre-fill the submit ticket form from URL parameters by default. To pre-fill the name, email and message fields from the link, add a short JavaScript code to your customer portal.

In the agent panel, go to Customer portal > Settings > change General Configuration > Tracking codes > Before </BODY> and paste this script into that field:

<script>
(function () {
    var params = new URLSearchParams(window.location.search);
    ['name', 'email', 'message'].forEach(function (field) {
        var value = params.get(field);
        var el = document.getElementsByName(field)[0];
        if (el && value !== null && !el.value) {
            el.value = value;
        }
    });
})();
</script>