Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Tenant notification issue. #4351


User avatar
0
velu created

Hi,

We are using ORACLE DATABASE.

*Notification to the specific user is working properly. This code is working, When we pass user identity.

public async Task SendMessageAsync(UserIdentifier user, string message, NotificationSeverity severity = NotificationSeverity.Info)
        {
            await _notificationPublisher.PublishAsync(
                "App.SimpleMessage",
                new MessageNotificationData(message),
                severity: severity,
                userIds: new[] { user }
                );
        }

But, Tenant specific notification has not inserted any data into notification Tables.

public async Task NewTenantRegisteredAsync(Tenant tenant)
        {
            var notificationData = new LocalizableMessageNotificationData(
                new LocalizableString(
                    "NewTenantRegisteredNotificationMessage",
                    moneyguruConsts.LocalizationSourceName
                    )
                );

            notificationData["tenancyName"] = tenant.TenancyName;
            await _notificationPublisher.PublishAsync(AppNotificationNames.NewTenantRegistered, notificationData);
        }

//Also this is not working
 await _notificationPublisher.PublishAsync(AppNotificationNames.NewTenantRegistered, notificationData);

Please help us to send the tenant-specific notification.(one notification to all user).

Please guide us on this.

Thanks.


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This problem is solved in this issue <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2783">https://github.com/aspnetboilerplate/as ... ssues/2783</a>. It will be fixed when you upgrade to ABP v3.3.

    Until ABP 3.3. released, you can override UserManager's IsGranted Method and use the code in given issue.

  • User Avatar
    0
    velu created

    Hi,

    We set multitenancy = false

    How can we override UserManager's IsGranted, In this case? :?: Thanks

  • User Avatar
    0
    aaron created
    Support Team

    You can override UserManager's IsGranted method regardless of whether MultiTenancy is enabled.

  • User Avatar
    0
    velu created

    Hi,

    After changes in the code, It is working properly. Code :

    using (_unitOfWorkManager.Current.SetTenantId(null))
                {
                    //Code for tenant notification
                }
    

    But, This notification sends only for subscribed users. In this case, How can we send notification for all user? (Send sample notification for all users like SendMessageAsync) Thanks

  • User Avatar
    0
    aaron created
    Support Team

    You can implement your own method and get all clients by _onlineclientmanager.GetAllClients();