The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Report and Flagging...
 
Share:
Notifications
Clear all

[Solved] Report and Flagging API Hooks?

16 Posts
2 Users
1 Reactions
2,506 Views
Tetrakern
Posts: 18
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tetrakern)
Eminent Member
Joined: 6 years ago
[#3601]

Hello,

I recently started to integrate the Flagging and Report addon. Now, I also ave a custom Moderator role and obviously I want to send moderations a notification when a comment has been flagged. Unfortunately, I can only add one email address. Is there an API hook or something else I can use to send the notification to other recipient as well? This would go well with this custom notification plugin.


15 Replies
Asti
Posts: 8208
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

We'll provide a solution in the next version of the addon. Please wait for the next update. 


7 Replies
Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti

 

image

Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

You can fill in the comma-separated email addresses of website administrators, moderators to get the notifications in the "Admin Email" field.

It's located in the Dashboard > wpDiscuz > Settings > Report & Flagging admin page. 


Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Tetrakern
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti ,

I see. Still, my needs have now evolved beyond this as I'm feeding notifications into a Discord channel now. This is far more efficient and centralized than spamming emails left and right, which drove us crazy anyway.

In regards to that, you may want to think of adding an interface for chat client webhooks anyway. The JSON structure may pose a challenge tho; otherwise it's stupid easy to push messages to channels.

Of course, I need to access the data for this when a report is made or auto-moderation happens. I guess I can intercept the email and pick it apart, probably by writing a JSON as body. But cannot say that's convenient.

Screen Shot 2022 01 21 at 13.07.53

Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
Tetrakern
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

The hook will be added in the next version.  


Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Tetrakern
Asti
Tetrakern
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti 

I see the hooks have been added. Nice. Is there a documentation on them somewhere? Currently, I cannot find the hooks in the API documentation.


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
Tetrakern
Asti
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

We're really sorry, but API documentation doesn't include the hooks for the addons. 

The following three hooks were added: 

add_action("wpdiscuz_rf_flagged", "my_custom_function");
add_action("wpdiscuz_rf_down_voted", "my_custom_function");
add_action("wpdiscuz_rf_reported", "my_custom_function");

The list of the arguments you can find below: 

   if (!function_exists("my_custom_function")) {
    
    function my_custom_function($args) {
        // $args["email_to"]  - the sent email, that is to whom the email goes
        // $args["email_subject"] -  the email subject@
        // $args["email_message"] -  the email body
        // $args["comment"] - the comment object that has been reported or down voted
        // $args["user"] - the current user object who reports or dislikes the comment, in case of guest this is empty        
    }        
}


Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Tetrakern
Asti
Tetrakern
Asti
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti 

Thank you.


Tetrakern
Posts: 18
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tetrakern)
Eminent Member
Joined: 6 years ago

I just noticed that you apparently cannot change the message for auto-moderation. It is not saved. I wanted to change it into a parsable structure. Took me hours to see that it doesn't save, searching the error on my side.


6 Replies
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

Probably you have some js errors on your website.  Please check your JS errors. It seems the problem comes from JS errors. Just press F12, go to the Console tab and check JavaScript errors.


Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Tetrakern
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti 

There are non JS errors, unfortunately. And you can save the "Report message body" just fine, but not the "Auto-moderation message body". It will always reset to default. It's also not saved via Ajax anyway afaik. The problem occurs on two independent servers. Turning off all plugins and using a standard theme doesn't work either.


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
Tetrakern
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

We'll check and get back to you asap.  


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Tetrakern
Asti
Tetrakern
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@tetrakern,

We'll check and get back to you asap.  

This issue will be fixed in the next version. 

Regarding the hook, we need some clarifications. Please let us know what data are needed in your case as arguments. 


Tetrakern
(@tetrakern)
Joined: 6 years ago

Eminent Member
Posts: 18
Asti
Tetrakern
Asti
Tetrakern
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@asti 

Essentially what's in the email -- report message, reported comment content/link/id, who submitted the report. Would probably be easier to just put in the whole comment object.


Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
Asti
Asti
Tetrakern
Tetrakern
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Thank you for your clarification, @tetrakern!

 


Share: