Is it possible to use ri:user without notifying the person concerned?
Asked by Philip Colmer:

I'm writing a script that creates a series of Confluence pages that details the membership of the groups on our in-house LDAP system. The design of the layout is such that members of a group are displayed on the page using the "@" or "ri:user" macro, e.g.:

![Screenshot 2021-03-04 112504.png](/t5/image/serverpage/image-id/132971i244A92FE7D8DAE56/image-size/large?v=v2&px=999 "Screenshot 2021-03-04 112504.png")

The drawback to this is that Confluence is notifying staff when the pages get created because that is the purpose of the "ri:user" macro.

Is there a way of \*preventing\* that notification from happening?

Alternatively, is there a different Confluence gadget or macro I can use that supports functionality like easy linking to the user's profile (which is why we picked the current method) without generating the notification?


Answers:
author: Dominic Lagger
body: HI [@Philip Colmer](/t5/user/viewprofilepage/user-id/510078)

As you already said, you can use the "User Profile" macro.

Are the pages all created in one go? If yes, you could disable the mail configuration, create the pages with the script and then enable the mail configuration again. But I'm not sure whether this is possible for cloud.

I do not know any other possibility

Regards, Dominic

comments: author: Philip Colmer
body: The script is intended to run nightly, to update the page content with any changes to our groups.

I might have a look at building a dynamic macro as the "User Profile" macro only displays email addresses for our own users and not external users, making the look of each page a bit inconsistent.


author: Mario Carabelli
body: You could create your own user macro in any way it pleases you, also it isn't a really straightforward experience to create one.

IF you look at <https://confluence.atlassian.com/doc/writing-user-macros-4485.html> you see at the bottoms of the page some examples. "Formatted panel" could be interesting.

You can velocity variabels in macros to get some information (like i.e. current User). Here are the variabels available in a macro: <https://developer.atlassian.com/server/confluence/confluence-objects-accessible-from-velocity/>.

You could use the $userAccessor variable to access the class [UserAccessor](https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.0/com/atlassian/confluence/user/UserAccessor.html)and its methods. For example this would make it possible for you to use $userAccessor.[getUserByName](https://docs.atlassian.com/ConfluenceServer/javadoc/7.11.0/com/atlassian/confluence/user/UserAccessor.html#getUserByName-java.lang.String-)([String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true "class or interface in java.lang") name) and deliver the name as an inputfield of the macro .

But like I said this is not the most straightforward way to do this. If the user profile macro is enough for you I would consult you to stay away of macro programming ;)

comments: author: Philip Colmer
body: Thanks [@Mario Carabelli](/t5/user/viewprofilepage/user-id/4284921) . Unfortunately, I don't \*think\* that user macros are available in Confluence Cloud.

I didn't explicitly mention it was Cloud in my question because I thought it showed up elsewhere on the web page.


author: Mario Carabelli
body: Your right. I overlooked the cloud part, but it shows in tags at the question.

If your interested in creating your own cloud macro: here is the link for it: <https://developer.atlassian.com/cloud/confluence/connect-macros/>

Unfortunately this means you have to basically write your own (simple) confluence app which may be overkill.

I think you are on the right path with the "user profile" macro. There is no way to disable the notification part of an [@mention](/t5/user/viewprofilepage/user-id/732788)-macro.


author: Philip Colmer
body: There is a "user profile" macro ... I'm going to try that on the page layout and see how that goes ...

User profile seems to be the way to go for our needs. It is slightly frustrating that it only displays email addresses for "internal" users.


Tags: cloud

confluence-cloud