Page 1 of 1

How to set subject of private message in compose window

PostPosted: Sun Mar 25, 2018 12:35 pm
by admin
Sometimes one wants to have a pm link with a subject and even the body content already filled out in the composition window. This way one knows exactly not only form who it came from but where it came from and why.

Lets say you want a user to send you (the admin) a pm after he is done doing something in his profile.

You want a PM sent to you with the following subject: "Things to do". And also, the following body: "I fixed the issue."

The pm link would look something like this:
Code: Select all
http://your-domain-name.com/support/ucp.php?i=pm&mode=compose&u=2&subject=Things to do&message=I fixed the issue


To make it work you need to do the following.

Go to : ~root/support/includes/ucp/ucp_pm_compose.php
FIND LINE 643:
Code: Select all
   if ($submit || $preview || $refresh)


Copy and paste this code (add before):

This code is hidden: 

To view this code please make a small donation or login to see it!


Done.

If you ever have a problem with your site parsing url links (the subject and body gets cut off), then add %20 in between the words (e.g. How%20to...).

Now if you are logged in to this site, you could try this pm with a generic thank you:
This message was hidden, please register or login to see message! ;)