Nicer user group management


(Andrew Harris) #1

I'm building a tool to allow users to subscribe and unsubscribe from various broadcast emails. It's an intranet, so all users are logged in, which is a nice start.

 

Matrix has two assets - the User Group Manager Page, and the BulkMail Subscribe Page - which both do a similar thing, link and unlink the current user to the prescribed user groups. So far so good.

 

Unfortunately, they're not very smart. They don't have awareness of which user groups you are already linked in, so they'll offer all the options to subscribe/unsubscribe, even though they're redundant. On a test BulkMail Subscribe Page, I've been able to use Javascript and some pattern matching to hide the redundant options, but that's pretty hacky.

Am I missing something here? are there undocumented alternatives to %subscriptions_picker% and %unsubscriptions_picker% which are more 'aware' of the status of the current user?

 

Even so, my client really just wants a single button, so essentially, a list of offerings, with a single button to subscribe or unsubscribe based on whether the currently logged in user is already a member of a group or not. eg:

  • List 1 [ Subscribe ]
  • List 2 [ Unsubscribe ]

The action is easy enough - I can use a trigger to do that, but I'm a bit stumped in just rendering the list. Ideally it would be an Asset Listing of the User Groups, and use a paint layout applied to each asset with conditional keywords to determine whether to show the subscribe or unsubscribe button. Unfortunately, this seems a bridge too far.

 

At the moment, I am stuck with the prospect of manually building the list in the paint layout, and hard coding an "In User Group Condition"keyword for each user group. It'll work, but it's not very elegant and manually maintaining stuff like this sucks.

 

Any brilliant ideas?

 

Apologies for length!


(Anthony) #2

If you have already been able to use some JS to hide the redundant options, could you not output both the subscript / unsubscribe links for each item and use similar JS to show / hide whichever option is not relevant?


(Andrew Harris) #3

Anthony, thanks for responding.

 

I guess it's all a bit muddled as I'm weighing up a number of options. Javascript is generally my 'last resort'.

 

Some of the requirements have also changed, and I'm now looking at how to provide a single link from, say, a news page (rather than a list), to 'subscribe' to email updates from that news source.

 

For this, I'm thinking that the way to provide the appropriate link would be to test for the presence of the user in the group via a conditional keyword applied through a Paint Layout. It's the only way I can think of to find out whether the user is already a member of the group. Make sense? I've yet to get this working properly, but I was in a rush when I made the first attempt, so I'll have another go soon.

 

I've also run into a little difficulty with the one click unsubscribe. I'm attempting to use the 'Remove Links' trigger action, but so far, my efforts to interpret the instructions in the manual on this action have failed me! If you have any gentle pointers in that direction, I'd greatly appreciate them.

 

My subscribe Trigger, 17:23776 is working fine, but although the unsubscribe trigger, 17:23777, fires fine, the actions must be somehow misconfigured as it does nothing.

 

Meanwhile, I'll keep chipping away :-)


(Andrew Harris) #4

Actually, just a little further on the conditional keyword thing. I am now pretty certain I have it set up correctly, but the page is still not correctly showing the conditional content. In fact, it changed overnight, but will not change again! Makes it sound like a caching issue.

 

id:#1274841 https://staff.unimelb.edu.au/subslist/

 

I haven't tested this with other users yet. It's just one of several problems I'm having with this suite of assets I'm building.

I actually started a ticket with one of the issues: #6635 starting to get a little frustrating.


(Andrew Harris) #5

Anthony, after a bit more fruitless tweaking and testing, I've raised several support tickets dealing with the issues I'm having setting this up.

6635, 8110, and 8112