using privatemsg_new_thread() inside an action - 2 problems

Created on 17 January 2011, almost 14 years ago
Updated 6 July 2023, over 1 year ago

Hi,

I'm writing an action for a module, and using the privatemsg api. I'm experiencing two problems.

1: Cannot set author
The following code works, and sends a message from "Guest":

  privatemsg_new_thread(user_load($uid), $subject, $body);

However, the following code doesn't work:

  privatemsg_new_thread(user_load($uid), $subject, $body, array('author'=>user_load(1)));

This doesn't send a message at all.

Alternatively,

  privatemsg_new_thread(user_load($uid), $subject, $body, array('author'=>$object));

does send a message, but still from "Guest," not the user identified in the array.

2: no e-mail notification
Even when I don't set the author and the message gets through, e-mail notification is not triggered. Is there a separate function for this, or is this a bug?

Any pointers in the right direction would be greatly appreciated!

cheers

🐛 Bug report
Status

Closed: outdated

Version

1.3

Component

Code

Created by

🇨🇦Canada haikubear

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024