Aggiungi un pulsante "Messaggio Personale" sul Post

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

Lo hai già qui nella finestra di composizione, fai clic sulla freccia di risposta in alto a sinistra, così, quindi seleziona Nuovo messaggio.

Ciao, vedo che ora mantieni questo plugin su GitHub?

Ho installato il plugin ma non sembra funzionare. Innanzitutto, il pulsante di attivazione è disattivato nella pagina dei plugin, vedi sotto. Non sono sicuro di cosa significhi?

Successivamente, le impostazioni dei valori non mostrano un pulsante accanto al nome dell’utente.

Questo plugin funziona ancora? Possiamo farlo funzionare?

Ciao,
Voglio aggiungere un pulsante “Invia messaggio” accanto al nome utente nei post, come mostrato di seguito:

Ho letto vari post relativi a questa funzionalità, ma nessuno di essi sembra soddisfare i miei requisiti.

Ho letto questo, ma questo rimanda a un componente tematico che aggiunge un pulsante in fondo all’argomento.

Qualche idea su come ottenere questo risultato?

Non sembra esserci una plugin outlet dove inserire il pulsante esattamente dove desideri:

Forse potresti accontentarti di averlo in topic-above-posts.

Quindi creeresti un componente glimmer che aggiunge il pulsante. Infine, useresti api.renderInOutlet per far apparire quel componente lì. Custom Components -- add button or text at any plugin outlet è un esempio di ciò.

Quindi modificheresti questo:

e troveresti semplicemente l’URL per avviare quel messaggio (Prefilled composer link generator potrebbe aiutare – devi solo sapere quale link desideri).

3 Mi Piace

Grazie per la risposta. È al di là delle mie capacità.
C’era un plugin per questi requisiti esatti, sembra che sia stato rimosso Add a "Personal Message" button on Post questo è quello che stavo cercando.

Ciao Sally! Mi chiedo perché tu voglia fare questo. Non vuoi che i tuoi membri rispondano all’argomento per avere una conversazione insieme? Aggiungere un link del genere inoltre ingombrerà l’interfaccia e distrarrà i tuoi membri.

Perché non ti basta che, quando clicchi sull’avatar/username, puoi vedere apparire una usercard che ha il pulsante per inviare direttamente un messaggio al membro?

3 Mi Piace

[citazione=“tobiaseigen, post:13, topic:186183”]
Mi chiedo perché vorresti fare questo. Non vuoi che i tuoi membri rispondano all’argomento per avere una conversazione insieme? Aggiungere un link del genere ingombrerà anche l’interfaccia e distrarrà i tuoi membri.

Perché non ti basta che, quando fai clic sull’avatar/nome utente, puoi vedere apparire una usercard che ha il pulsante per inviare direttamente un messaggio al membro?
[/citazione]

Sto cercando di costruire un sistema di messaggistica in cui gli utenti possono pubblicare nel forum, ma la caratteristica principale è l’invio di messaggi tra loro. Quindi voglio che il pulsante Messaggio sia visibile. Qualsiasi nuovo utente impiegherà del tempo per capire come inviare un messaggio.

1 Mi Piace

È un uso interessante di Discourse! Potresti cavartela semplicemente impegnandoti di più per educare i tuoi membri su come accedere alla scheda utente per rispondere tramite messaggio personale (o chat? stai usando anche la chat?). Potresti creare un banner persistente nella parte superiore, ad esempio. E spiegare come accedervi nel tuo messaggio di benvenuto.

Se hai assolutamente bisogno di questo pulsante e hai un budget, puoi pubblicare su Marketplace e magari qualcuno qui può costruirlo per te.

L’ho già fatto, mostrando in alto, inviando istruzioni nel messaggio di benvenuto, nella pagina “chi siamo” e così via.

Non uso la chat, i messaggi vanno bene per me.

Sì, sarebbe l’ultima risorsa.

Vorrei che qualcuno rianimasse questo plugin dato che in passato ha funzionato, vero?

Sono l’autore originale. Anche se funzionasse ancora, il plugin aggiunge il pulsante solo al primo post, non a ogni post.

3 Mi Piace

[citazione=“merefield, post:17, topic:186183, full:true”]
Anche se funzionasse ancora, il plugin aggiunge il pulsante solo al primo post, non a ogni post.
[/citazione]

Ciao Robert, sì, è esattamente quello che voglio, aggiungere il pulsante Messaggio accanto al primo post dell’autore originale (OP - Original Poster).

Il problema è che il plugin non funziona, non mostra il pulsante Messaggio. L’ho installato. Vedo che il pulsante On è grigio nella pagina dei plugin per questo plugin, non sono sicuro di cosa significhi?

Saresti in grado di ripristinare questo plugin? Per favore? Se hai un po’ di tempo libero.

In realtà, il mio componente tema per componenti personalizzati funzionerebbe.

Basta inserire l’URL per avviare un PM (penso che funzioni?) e l’outlet del plugin che ho menzionato sopra nelle impostazioni.

Modifica:
Oh. Dannazione.
No. Hai bisogno di questo
https://your.discourse.site/new-message?username=username
E non c’è alcun meccanismo per includere il nome utente dell’argomento.

Se hai un budget e desideri sponsorizzare il lavoro, mandami un messaggio privato.

2 Mi Piace