News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Where is the private message function located?

Started by rcane, October 31, 2022, 04:21:53 PM

Previous topic - Next topic

rcane

In the same vein as calling the php mail() I'd like to have a php page send a conformation PM to a member when using some form interfaces I made.  I'm still able to have the down time to upgrade the server to get unlimited mail; so in the meantime sending PM's will work fine.

I'm just looking to find the function to see how to make a canned PM and send it to the $user_info['id'] that's using the form.



rcane

Quote from: Doug Heffernan on October 31, 2022, 04:48:54 PMThat would be sendpm().

Thanks Doug.  I still need the location too though, to know what gets passed to it--no?

Doug Heffernan

Quote from: rcane on October 31, 2022, 04:51:22 PMThanks Doug.  I still need the location too though, to know what gets passed to it--no?

Have a look at the below link. It contains all the info on the subject.

https://support.simplemachines.org/function_db/index.php?action=view_function;id=315

You can see the whole aforementioned function at the Subs-Post.php file.

rcane

Quote from: Doug Heffernan on October 31, 2022, 04:56:21 PM
Quote from: rcane on October 31, 2022, 04:51:22 PMThanks Doug.  I still need the location too though, to know what gets passed to it--no?

Have a look at the below link. It contains all the info on the subject.

https://support.simplemachines.org/function_db/index.php?action=view_function;id=315

You can see the whole aforementioned function at the Subs-Post.php file.

wow, that function is huge. 

That's going to be a lot of work to do what amounts to sending a PM to one's self with a canned message in it.

I am curious though, why it uses those pm_id and then goes through the trouble to search and correlate a pm_id into an actual id_member.   I'm sure there's a reason, but the extra steps aren't obvious to me.

Aleksi "Lex" Kilpinen

Quote from: rcane on October 31, 2022, 05:47:12 PMThat's going to be a lot of work to do what amounts to sending a PM to one's self with a canned message in it.
Not really, since you should be able to just reuse the existing sendpm() function as is.
That's what it's for, that's why it's available and documented.

Most of SMF is built so that you don't need to go dig in to the code much if you want to reuse something that SMF already does.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

rcane

#6
Quote from: Aleksi on October 31, 2022, 06:53:55 PM
Quote from: rcane on October 31, 2022, 05:47:12 PMThat's going to be a lot of work to do what amounts to sending a PM to one's self with a canned message in it.
Not really, since you should be able to just reuse the existing sendpm() function as is.
That's what it's for, that's why it's available and documented.

Most of SMF is built so that you don't need to go dig in to the code much if you want to reuse something that SMF already does.


I thought so.  Can you do me a favor and show an example? Dummy me.  I wasn't sure if the $variables there are the ones it's going to need or if they're placeholders as you'd do with something like:

$name = 'bob';

function printer ($n) {
echo $n;
}

printer ($name);


Illori

what exactly are you adding? if it is plain text you might be able to add it to the email template.

Advertisement: