הוספת כפתור "הודעה אישית" על פוסט

Do you think it is possible to add a “Private Message” button to the topic first post? :thinking:

I am surprised that many users don’t know how to send PM to OP, because the PM button is not visible unless they click on the OP’s avatar.

For example,


Currently, I am using the " discourse-custom-topic-button" plugin.

And use the url of
example.com/new-message?username=<TOPIC_USERNAME>&title=Re:<TOPIC_TITLE>

However, when user click on the button, it jump to the front page immediately, before the Message editor show up. It doesn’t act the same as the “Message” button in user card. If you click on the “Message” button in user card, it show up the message editor immediate without jumping to other page.

Do you think it is possible to make the custom button (new-message url) act the same as the Message button in user card ? :thinking:

I recently built this for a client:

https://github.com/paviliondev/discourse-pm-topic-author

It is open-source. It may suit your needs. Just add the Categories you want it to appear in. Let me know if you hit any bugs.

Unfortunately I don’t have time to extend it at present.

Thanks to @davidkingham for commissioning us to do the work and allowing this to be open source, and in turn therefore supporting the wider community.

10 לייקים

Thank you very much. :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

It works exactly what I am looking for. :partying_face: :partying_face: :partying_face:


Just out of curiosity, :grinning:

Do you think I can add
{{#if this.user.can_send_private_message_to_user}}
to “pm-topic-author.hbs” , so that the button won’t show up if the user is the same as the OP ? :thinking:

Similar to Discourse User card “user-card-contents.hbs

pm-topic-author.hbs

3 לייקים

Good catch!

Given we already have the showPMTopicAuthorButton property, we should probably do that in JS, though your solution is a great interim approach.

3 לייקים

So I’ve done that with JS:

https://github.com/paviliondev/discourse-pm-topic-author/commit/a82ac238d9dce2291e827b66784aef1715e077c0

Thanks for your feedback.

Upgrade when you get chance and please confirm that works for you.

10 לייקים

Thank you very much for the update. :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

Now It works perfectly well for login user. :partying_face: :partying_face: :partying_face:

However, it seem after updated, the plugin cause some error for non-login user. When non-login user visit the page, it get a blank post. It only show the title, category, tag, but everything below is empty . :thinking:

Browser Inspector:
2021-04-11_053333

Error log:

לייק 1

https://github.com/paviliondev/discourse-pm-topic-author/commit/ed5a0128c754e1017a752a08bf3725acf3f5bfb5
Schoolboy error :man_facepalming:t3:- introduced that in last change. Hopefully that resolves it for you :slight_smile:

4 לייקים

You already have it here in the composer, click on the reply arrow at upper left, like so, then select New Message.

image

Hello, I can see that you now maintain this plugin on github?

I’ve installed the plugin but it doesn’t seem to work. Firstly the on button is greyed on Plugins page, see below. Not sure what it means?

Next, setting values doesn’t show button next to user’s name.

Does this plugin still work? Can we make it work?

Hello,
I want to add Send Message button next to user’s name on the posts like shown below:

I’ve been reading various posts related to this feature but none of them seem to satisfy my requirements.

I’ve read this but this points to theme component which add button at the bottom of topic.

Any ideas how to achieve this?

It doesn’t look like there’s a plugin outlet to put the button exactly where you want:

Maybe you could settle for having it at topic-above-posts.

Then you’d make a glimmer component that adds the button. Finally, you’d use api.renderInOutlet to have that component show up there. Custom Components -- add button or text at any plugin outlet is an example of that.

So then you’d modify this:

and just figure out the URL to start that message (Prefilled composer link generator might help – you just need to know what link you want).

3 לייקים

Thanks for the reply. It is beyond my capabilities.
There was a plugin for this exact requirements, seems to have been scraped Add a "Personal Message" button on Post this is what I was looking for.

היי סאלי! אני תוהה למה תרצי לעשות את זה. את לא רוצה שהחברים שלך יגיבו לנושא כדי לנהל שיחה ביחד? הוספת קישור כזה גם תסרבל את הממשק ותסיח את דעתם של החברים שלך.

למה זה לא מספיק לך, שכאשר לוחצים על האווטר/שם המשתמש, אפשר לראות חלון משתמש שקופץ ויש בו כפתור לשלוח לחבר הודעה ישירות?

3 לייקים

I’m trying to build a messaging system where users can post in the forum but the main feature is sending messages to each other. So I want Message button to be visible. Any new user will take time to figure out how to send message.

לייק 1

זה שימוש מעניין בדיסקורס! אתה יכול להסתדר רק על ידי חינוך נוסף של החברים שלך כיצד לגשת לכרטיס המשתמש כדי להשיב באמצעות הודעה אישית (או צ’אט? האם אתה משתמש גם בצ’אט?). אתה יכול ליצור באנר קבוע בחלק העליון, למשל. ולהסביר כיצד לגשת אליו בהודעת הפתיחה שלך.

אם אתה ממש צריך את הכפתור הזה ויש לך תקציב, אתה יכול לפרסם ב-Marketplace ואולי מישהו כאן יכול לבנות אותו עבורך.

I’ve already done that, showing at the top, sending instructions in welcome message, about us page and so on.

Not using chat, messages will do for me.

Yes, that would be last resort.

I wish someone could revive this plugin as it did work in the past, didn’t it?

אני המחבר המקורי. גם אם התוסף עדיין היה עובד, הוא היה מוסיף את הכפתור רק לפוסט הראשון ולא לכל פוסט.

3 לייקים

Hi Robert, Yes that’s exactly what I want, to add the Message button next to OP’s first post.

The problem is that plugin doesn’t work, it doesn’t show Message button. I’ve installed it. I can see that the On button is greyed on Plugins page for this plugin, not sure what that means?

Would you be able to revive this plugin? Please? If you get some free time.

Actually, my custom components theme component would work.

Just put on the url to start a pm (I think that works?) and the plugin outlet I mentioned above in the settings.

Edit:

Oh. Darn.

No. You need this

 https://your.discourse.site/new-message?username=username

And there is no mechanism to include the topic username

If you have budget and would like to Sponsor the work, PM me.

2 לייקים