Solved

Moderator Approval Banner


Our Community is publicly accessible, but our users must be registered and approved in order to access certain parts of the system such as Product Updates. I have to manually approve each user and assign them a custom role. As with any manual process, there is a delay between when a user registers and when i grant them access. There is a banner that displays to the user letting them know they have to activate their account through a link in their email. This is very helpful.

When they select the link in the email to activate their account, the Community opens with a red banner that says that their account needs moderator approval. I like this banner but would love to know the hidden phrase so that I can update the terminology so that users understand that it might take a day to get full access. Another issue is this banner appears only once, briefly. The banner doesn’t stay visible to the user until the record is approved.

TLDR;

  1. How can I change the phrase for the activate and moderator approval needed messages? I understand how to make the changes, but I don’t know the super secret key word.
  2. Can I make the moderator approval banner stay? I want the banner to display to the user on every window until their record is approved so that they can easily see why they don’t have instant access after registering.
icon

Best answer by SmartlyGreg 13 May 2022, 04:25

View original

4 replies

Badge

@Chelsea Roberts I’ll do my best to address this one but you might need to rework it a little!

While I’m sure you can change the notification on the homepage the circumstances in which it appears are set already and therefore your point 2 invalidates the use of the existing one…

As I see it you can create a new notification that looks like this based on the role of the user, by adding this code to the last box in the Third Party Scripts page:

<script>
<!-- When the user role is not the higher access one for someone logged in -->
if ((!inSidedData.user.role.includes('CUSTOM ROLE NAME WITH HIGHER ACCESS RIGHTS')) && inSidedData.user.userid > 0) {
<!-- Add a banner in the same style as the notification for email confirmation -->
var messageLoc = document.getElementsByClassName("templatehead")[0];
var bannerDiv = document.createElement("div");
var messageDiv = document.createElement("div");
<!-- Set the exact message you want displayed here -->
var message = document.createTextNode("Certain parts of the community will not be available until Moderator review of your new account. Please allow for up to 48 hours.");
messageDiv.appendChild(message);
messageLoc.appendChild(bannerDiv).setAttribute('class', 'box box--success customMess');
var bannerLoc = document.getElementsByClassName("customMess")[0];
bannerLoc.appendChild(messageDiv).setAttribute('class', 'box__pad');
}
</script>

And then you can customize the message style further to your taste with the CSS class “customMess”.

Hope this helps!

Thank you, @SmartlyGreg ! This is very exciting and i’m excited to try this out. Would I insert this code into Third Party Scrips head or body, or an HTML widget via the customization on the welcome page? I’m a total newbie, so I’m still figuring out some of the customization elements.

Badge

@Chelsea Roberts of course no worries! I’ve added it above before the code that it needs to go into the Third Party Scripts page (in the last box). 

The reason why it is done this way is that it ensures that it will always appear on any page, contrary to a HTML widget.

BTW if you are really not familiar with this I would recommend not implementing anything like this on your own! As its quite easy to insert malicious code on a site if someone is willing to paste it in their backend! Of course, I know that I didn’t do anything wrong here but sadly there is no way to distinguish me from someone who would! But also I’ve not fully tested this so there could be flaws or certain pages where you’d rather this not show up...

Userlevel 5
Badge +4

Greg’s the pro with third party scripts and customization, but just wanted to chime in and say that something like this is possible using the the existing widgets. You can configure a widget to show only for certain roles, which “Users Awaiting E-Mail Confirmation” is one of. I do something similar for our Super User role. 

The pro of this approach (probably with a third party script or custom CSS like Greg suggests) is that you that can make it visible for only that role. For my use case, I created the widget I wanted some to see (and not others) and asked support to help me setup the necessary script/CSS. 

Reply