notification_id as item_id

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
caiocald
Registered User
Posts: 213
Joined: Mon Feb 26, 2018 9:32 pm
Name: B!

notification_id as item_id

Post by caiocald »

when configuring notifications for my extension I noticed that in the part:

Code: Select all

public static function get_item_id($data)
    {
        return $data['topic_id'];
    }
the "item-id" column does not allow repetition. That is, if two users trigger notifications, the author will only receive one notification, as the topic id will be the same.

Is there any way to get the "notification-id" column to enumerate the "item-id"?
rxu
Extensions Development Team
Posts: 3712
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: notification_id as item_id

Post by rxu »

caiocald wrote: Thu Aug 27, 2020 2:00 am Is there any way to get the "notification-id" column to enumerate the "item-id"?
What do you want to achieve basically? It is possible to just update 'old' notifications, you can get an example in phpBB core, like https://github.com/phpbb/phpbb/blob/985 ... e.php#L105
User avatar
caiocald
Registered User
Posts: 213
Joined: Mon Feb 26, 2018 9:32 pm
Name: B!

Re: notification_id as item_id

Post by caiocald »

rxu wrote: Thu Aug 27, 2020 5:42 am
caiocald wrote: Thu Aug 27, 2020 2:00 am Is there any way to get the "notification-id" column to enumerate the "item-id"?
What do you want to achieve basically? It is possible to just update 'old' notifications, you can get an example in phpBB core, like https://github.com/phpbb/phpbb/blob/985 ... e.php#L105

I don't know how I can explain it.

But the notifications are identified by the column "item_id", correct?

To send different notifications, the card will need different "item_id".

The problem is that I use "forum_id" to configure "item_id".

If more than one user evaluates the same topic, the author of the topic will only receive ONE notification, understand?

I don't know if I explained it clearly. Sorry
rxu
Extensions Development Team
Posts: 3712
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Contact:

Re: notification_id as item_id

Post by rxu »

caiocald wrote: Thu Aug 27, 2020 8:55 pm If more than one user evaluates the same topic, the author of the topic will only receive ONE notification, understand?
You can update already sent notification if more than 1 user perform some action in your notification type. Example is linked above.
It will look like f.e. "User1 evaluated your topic" for 1 user and "User1, User2 and 146 more users evaluated your topic" for a number of users.
I don't know if I explained it clearly. Sorry.
User avatar
caiocald
Registered User
Posts: 213
Joined: Mon Feb 26, 2018 9:32 pm
Name: B!

Re: notification_id as item_id

Post by caiocald »

rxu wrote: Fri Aug 28, 2020 2:22 am
caiocald wrote: Thu Aug 27, 2020 8:55 pm If more than one user evaluates the same topic, the author of the topic will only receive ONE notification, understand?
You can update already sent notification if more than 1 user perform some action in your notification type. Example is linked above.
It will look like f.e. "User1 evaluated your topic" for 1 user and "User1, User2 and 146 more users evaluated your topic" for a number of users.
I don't know if I explained it clearly. Sorry.

I understand perfectly! thank you!

In this case, how the email notification would happen in this situation of updating the notification
Post Reply

Return to “Extension Writers Discussion”