It looks like you're new here. If you want to get involved, click one of these buttons!
businessdad
MVP
As per subject, my client would like Users to receive a notification when their answers are accepted or rejected. I had a look at the plugin, and I see that it calls AddActivity when an answer is accepted. Would it be possible to do the same when an answer is rejected?
Also, would it be possible to make these notifications optional, the same way it's done with others (e.g Notify me when people write on my wall) ?
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
Comments
Update: after making some experiments, I think I achieved what I wanted. It was simpler than I thought, just a handful of lines of code.
May I submit the changes for review, and eventually have them added to the main plugin? They don't interfere with main logic, and I believe other people could use them. Thanks.
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
2 · Insightful 2Awesome LOL ·I don't see why not...try issuing a pull request here and see if they accept it.
https://github.com/vanillaforums/Addons/tree/master/plugins/QnA
- Spam
- Abuse
0 · Insightful Awesome LOL ·@mcu_hq Thanks, I was looking for that! Time to refresh mi Git skills.
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
0 · Insightful Awesome LOL ·We do love accepting pull requests. Sending an email upon answer rejection is something that would need a config option since most people aren't supposed to know their answer has been rejected.
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·@Todd Thanks, I'm issuing a Pull Request right now. I haven't thought about a global configuration setting for notifications, therefore my update only allows Users to choose if they want to receive the notification.
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·How can I remove all notifications related to this plugin (i.e. when an answer is accepted - don't send any email). I've looked through the https://github.com/vanillaforums/Addons/tree/master/plugins/QnA but couldn't find anything related to this.
My screenshot below doesn't list these as available options, not sure if I'm just doing something wrong. I'm hoping this could be as easy as just writing a
$Configurationstring.- Spam
- Abuse
0 · Insightful Awesome LOL ·you would have to change the plugin
comment out
$Sender->InformMessage
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
2 · 1Insightful 1Awesome LOL ·Thank You! I just didn't know where to look.
- Spam
- Abuse
0 · Insightful Awesome LOL ·Unfortunately the two related code strings I can find with what you've mentioned are:
static $InformMessage = TRUE; if ($InformMessage && Gdn::Session()->UserID == GetValue('InsertUserID', $Discussion) && in_array(GetValue('QnA', $Discussion), array('', 'Answered'))) { $Sender->InformMessage(T('Click accept or reject beside an answer.'), 'Dismissable'); $InformMessage = FALSE;and
$Count = Gdn::SQL()->GetCount('Discussion', array('Type' => 'Question', 'InsertUserID' => Gdn::Session()->UserID, 'QnA' => 'Answered')); if ($Count > 0) { $Sender->InformMessage(FormatString(T("You've asked questions that have now been answered", "<a href=\"{/discussions/mine?qna=Answered,url}\">You've asked questions that now have answers</a>. Make sure you accept/reject the answers.")), 'Dismissable'); } }When altering these (i.e. changing from
TRUEtoFALSE, this only disables the popups that this command prompts. I'll keep looking around the plugin to see where to disable this email notification.- Spam
- Abuse
0 · Insightful Awesome LOL ·I thought thats what you wanted notification messages. You probably have to block email when it gets written to activity. I'll see if I can find it.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·well changing
// Record the activity. if ($QnA == 'Accepted') { AddActivity( Gdn::Session()->UserID, 'AnswerAccepted', Anchor(Gdn_Format::Text($Discussion['Name']), "/discussion/{$Discussion['DiscussionID']}/".Gdn_Format::Url($Discussion['Name'])), $Comment['InsertUserID'], "/discussion/comment/{$Comment['CommentID']}/#Comment_{$Comment['CommentID']}", TRUE ); } }from
TRUEtoFALSEdisables email notifications while not disabling the popups on the page, but it also disables non-email notifications within the forum itself. No activity is recorded on the profile page of the user, but that appears to be the only way to disable email that I can see. Thank you @peregrine your comment about blocking it while it gets written to activity helped me find this.- Spam
- Abuse
2 · 1Insightful 1Awesome LOL ·glad you found it, saved me time looking :)
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
1 · Insightful Awesome 1LOL ·Ok - I see the logic - But it has to be possible to be able to disable EMAIL notifications while not disabling Notifications WITHIN the forum (i.e. still have them show up under the "Notifications" tab in the profile page)
This method prevents the acceptance from being recorded to activity - therefore disabling any notification associated w/ it.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@businessdad - I know this was awhile ago but this current plugin does not give this option. Do you know what happened? How to give users the option to receive notifications for accepted answers?
- Spam
- Abuse
0 · Insightful Awesome LOL ·I don't think that my changes were ever pulled into the main repository. You can have a look at my forked repository to see the changes. Just keep in mind that they were not made against the latest master, but against the latest version which was still compatible with Vanilla 2.0 (branch name is Working_with_Vanilla_2.0.18.x).
Awards/Badges Plugin now available! | My blog - About Me - My Plugins for Vanilla
- Spam
- Abuse
1 · 1Insightful Awesome LOL ·Well I suppose my solution did just remove the notification altogether.
I think there is something overall buggy with notifications. I might just hide them in css for my forum.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@chrisk22985
I'm assuming that you could achieve a solution to your email problem by adding a string within your config.php file
something along the lines of:
only for your Q&A plugin, so maybe,
$Configuration['Preferences']['Email']['Q&A Accepted'] = '0';I can look into this, probably just by playing around with different combinations of words until something works - may take awhile - I suggest you keep playing with it too.
EDIT
And I see you've been active on this page as well
http://vanillaforums.org/discussion/23411/email-notifications-going-crazy#latest
so if you decide to work on this yourself instead of contracting out, I wish you well!
- Spam
- Abuse
0 · Insightful Awesome LOL ·Having no luck taking the config.php route. Every test the user still receives an email notification.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@kirkpa31 You could search the source code for 'Preferences.Email' and it will list out all the different configurations used.
No need to guess
Search first.
React to insightful, awesome, funny, and off-topic posts.
Check out the Wiki for lots of information about common stumbling blocks.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@hgtonight
@vrijvlinder made a list of everything that sends notifications in this post: http://vanillaforums.org/discussion/comment/179988/#Comment_179988 but the Q&A plugin is not referenced here, hence my need to guess.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@kirkpa31
I just mean that you can quickly find all the configurations referenced by searching the source code files. Configurations are checked in code by
C('FirstBox.SecondBox.ThirdBox.Etc', 'Default Value');Search first.
React to insightful, awesome, funny, and off-topic posts.
Check out the Wiki for lots of information about common stumbling blocks.
- Spam
- Abuse
1 · 1Insightful Awesome LOL ·Ahhh thank you! I will use your advice to change my attempt.
- Spam
- Abuse
0 · Insightful Awesome LOL ·@kirkpa31
You can either join the "cargo cult guessing game school of red herrings" by guessing configs, definitions, and events or you can do what @hgtonight said (which is the correct way to go imo, and hgtonight will put your train back on the proper track.). It will keep you from trying non-existent configs and nonsensical suggestions.
some configs can't be found by searching for C( but the link below shows other options for finding all configs.
@kirkpa31
this will get you on the path to enlightenment and away from the dark side of mysticism, crystal ball and red herrings.
http://vanillaforums.org/discussion/comment/171978/#Comment_171978
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
1 · Insightful Awesome 1LOL ·If I don't reply back in the next couple of days, know that it is b/c I've drowned in the source code. But at least now I know what direction land is in, so I will use your advice and start a new trek.
Thanks guys!
- Spam
- Abuse
0 · Insightful Awesome LOL ·!!! I think I solved it !!! - in all my tests this works - i.e. other notifications are still emailed to the user when they select that particular preference - but if anyone sees something that may cause this to mess up other notifications that I'm currently overseeing, please chime in.
could not get a config.php solution
within /applications/dashboard/models/class.activitymodel.php
EDIT
Changed the word
'Force'in the first part of the if else statement to''around line 477:to:
@peregrine I tried to employ a half educated-guessing and half red-herring methodology for this - my specialty
Utilizing Vanilla V. 2.0.18.8
- Spam
- Abuse
4 · Insightful 4Awesome LOL ·kirkpa31
It's not a red herring if you tested and it works. nice work! I don't use the plugin, but I'm sure this may help others if it works as you say it does.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·Oh I'm happy I signed on this morning to see this! Thank you @kirkpa31!!!!
- Spam
- Abuse
1 · Insightful 1Awesome LOL ·This is what I like to see, people asking for help but still try to do it themselves, makes me proud! @kirkpa31 Congratulations
- Spam
- Abuse
2 · Insightful 2Awesome LOL ·