Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
email notification to poster?
RAANZ
New
Currently notifications are sent only to other listeners, but not the poster of a discussion or comment.
It can be useful for a copy to be sent to the poster- as if they were just another listener.
Can this be selected in the config file?
0
Comments
I don't believe there is an option in preferences or config file.
what you are looking for is some kind of carboncopy emailer. that is selectable per user to email a copy of an individual's post.
I know if you mention yourself in a post @peregrine you don't get a notification either to prevent the behavior.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
All sorted.
I started to write an add-on to do it but the learning curve is fairly steep.
So I took the easier path, found the code that specifically discards emails to the author, and commented it out.
class.activitymodel.php lines 1075-76 and 1111-1115
I know this may get overwritten on any upgrade, but it gets around the problem while I learn how to write an add-on to override that function.
I upgraded to V2.2 and repeated the exercise- same file but a number of lines further down in this version.
vanillaforums/applications/dashboard/models/class.activitymodel.php lines 1218-20 and 1275-79
You already have shown that you know that altering core files is bad practice. If you have decided to solve your problems that way, it is okay.
But now that repeat your advice, I feel the need to repeat the warning:
/!\ Don't change core files! /!\
Don't hesitate to ask when you get stuck creating your plugin.
Understood.
Just working my way through a legit solution.
I will post here once I have it sorted.
@R.J Some help please.
From the plugins documentation
I have tried this- copying the two functions I modified (queue and save) into my plugin-
class NotifyAuthorPlugin extends Gdn_Plugin { public function queue($Data, $Preference = false, $Options = array()) { ... } public function save($Data, $Preference = false, $Options = array()) { ... } }
but no joy.
I suspect the issue is the naming of these overriding functions needs a full extended name?
So what should I call these, overriding vanillaforums/applications/dashboard/models/class.activitymodel.php/queue{} and save{}?
Vanilla is object oriented. In the world of OOP you have "classes" and "methods". Methods are defined with the word "function" but they are still called "methods". And the cited sentence is only true for functions that are defined outside of classes.
The common way in Vanilla to influence the program flow is by using events. All through the code you find "EventArgument" and "FireEvent". So you have to find where you find those keywords in the near of where you try to change something.
You've changed the activity models method queue because you want to change the behaviour of what is happening when someone saves a comment. So do a search for "activitymodel->queue" in class.commentmodel.php
Personally I think what you try to achieve doesn't make sense at all, but I guess that part might fit best what you need:
We would have to call that code before the activity notification mechanism starts, correct? Looking through the CommentModel, you'll find:
$this->fireEvent('BeforeNotification');
and that's what we need.Are you on a test system? You should. You could either continue reading code or start testing like crazy - that's what I prefer
Put this code in your plugin:
Create a discussion as user A. Log in as User B and write a comment to this discussion.
Then open up the log file.
You will see that one argument is the comment. You need that for the user that should be notified.
Another argument is the Activity. You need that as a blueprint.
And you have got the ActivityModel. You need that to queue your rubbish
See what I did? I put together what we had above and added
'Force' => true
because that's what will cause the method queue to not kill this entry.