0

I have a "system" user that sends "Welcome to the website" private messages as well as announcements to users. I am able to send these messages via rules; however, I don't want users to be able to reply to these messages.

I tried disabling private messages for the system user but that option disables both the receiving and sending of private messages (I checked-- if private messages are disabled for a user, no private message can be mailed from that user using rules).

I don't need a solution that is bulletproof; hiding the reply form on the private message view screen is sufficient. However, I dug through the private message module code and was unable to find any way to do that.

1 Answer 1

3

There are two ways to do this.

  1. The pm_block_user module has settings that allow for role-based configurations for who is allowed to write whom. However, it is only possible to add positive rules. Meaning, you wold need to add all your users into a normal role that the system user is not part of and then allow users of that role to write users of that role.

  2. Implement hook_privatemsg_block_message() and block the system user id.

You're welcome to provide option two as a patch in the main module (e.g. allow to choose a system user whom you can't write/reply and is maybe also themed differently). This is an often requested feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.