Forum Discussion

dasyurid's avatar
10 years ago

Customised Accepted Solution Success message

Hi,

 

We've done some work customising the "Success" text string that comes up when a post is marked as an Accepted Solution. To date we've done this using the text keys, however we would like to do something more complex and so far I've had no luck getting it working.

 

What we want to do is when a post gets marked as an Accepted Solution:

 

1. The role of the person marking it is checked.

2. If they have a role that matches one of our staff roles, they are given "Success Message A".

3. If they do not have one of the staff roles, they are given "Success Message B" and a script run to popup a survey.

 

What's the easiest way to do this? I've built freemarker code into a Component that emulates this, except for the very first part where it gets triggered after a post has been marked as Accepted Solution. The freemarker code doesn't (appear to) work in a text key, however I have seen other text keys that use #if and #else terminology so I'm assuming what I want to do can be done - it's just not done through freemarker and potentially needs know-how I've not got...

3 Replies

  • dasyurid's avatar
    dasyurid
    Ace
    10 years ago

    OlivierS wrote:

    @dasyurid why don't you add some logic in your email template?

     

    Email template

    Email template context objects


    OlivierS Because it's not the email I'm looking to change (we've alreayd made changes to the Accepted Solution emails). It's the little message that is displayed above the post after the Accepted Solution is marked. The text key is feedback.MarkMessageAsAcceptedSolutionAction.succeed and defaults to saying "Success! This post is now set as Best Answer.". (Note: we've renamed "Accepted Solution" for our community).

     

    What we'd like to do is have that message be customised for specific roles, and to be able to launch a popup survey.

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    10 years ago

    You could override the core component responsible for displaying the feedback message (I think you can find it in the common header - if you haven't customized it), add the logic that applies in your specific situation and revert to the default behavior in all other cases.