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.

Advance Notifications config lines?

yofalyofal New
edited June 2012 in Vanilla 2.0 - 2.8

This may seem like old news - but I'm just not finding this anywhere on the forums…

Where the heck are the config lines for the extra preferences enabled by the Advanced Notification option? They don't seem to appear in the default config page, nor in the documentation.

Best Answer

  • peregrineperegrine MVP
    edited June 2012 Answer ✓

    yes read the above messages on changing the database. BACKUP any tables you plan to change first.

    it looks like just changing the usermeta table is the way to do it.

    add users to usermeta with a value of 1 and Name Preferences.Email.NewDiscussion
    and a value of 1 and Preferences.Email.NewComment.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • check conf/config-defaults.php first. Then please explain what you mean with the 'advanced notification option' :-)

    There was an error rendering this rich post.

  • There is an option when setting user permissions for Garden to allow "Advanced Notification". As I understand it, this gives the user a couple new notification preferences, notably "Notify me when people start new discussions." and "Notify me when people comment on a discussion."

    I'm not seeing the config lines for these two preferences - and I'd love to be able to set these prefs individually for new members, given that at least one of them is potentially so "noisy".

    Here are the notification prefs I see in config.defaults.php:

    // Default Preferences
    $Configuration['Preferences']['Email']['ConversationMessage'] = '1';
    $Configuration['Preferences']['Email']['AddedToConversation'] = '1';
    $Configuration['Preferences']['Email']['BookmarkComment'] = '1';
    $Configuration['Preferences']['Email']['WallComment'] = '0';
    $Configuration['Preferences']['Email']['ActivityComment'] = '0';
    $Configuration['Preferences']['Email']['DiscussionComment'] = '0';
    $Configuration['Preferences']['Email']['DiscussionMention'] = '0';
    $Configuration['Preferences']['Email']['CommentMention'] = '0';
    $Configuration['Preferences']['Popup']['ConversationMessage'] = '1';
    $Configuration['Preferences']['Popup']['AddedToConversation'] = '1';
    $Configuration['Preferences']['Popup']['BookmarkComment'] = '1';
    $Configuration['Preferences']['Popup']['WallComment'] = '1';
    $Configuration['Preferences']['Popup']['ActivityComment'] = '1';
    $Configuration['Preferences']['Popup']['DiscussionComment'] = '1';
    $Configuration['Preferences']['Popup']['DiscussionMention'] = '1';
    $Configuration['Preferences']['Popup']['CommentMention'] = '1';

    So I see 8 sets here (email and pop-up), but checking "Advanced Notifications" adds two more (10) for every user that I'm not seeing above.

    Any ideas?

  • peregrineperegrine MVP
    edited June 2012

    be careful:

    http://vanillaforums.org/discussion/20385/help-stop-the-auto-email-to-all-forum-members-everytime-i-post

    most likely a guess would be if it can bet set in the config file. Unfortunately this may set it for all your users too. But changes now would probably only affect the preference for new users.

    $Configuration['Preferences']['Email']['NewDiscussion'] = TRUE; 
    $Configuration['Preferences']['Email']['NewComment'] = TRUE; 
    
    $Configuration['Preferences']['Email']['NewDiscussion'] = FALSE; 
    $Configuration['Preferences']['Email']['NewComment'] = FALSE; 
    

    maybe todd will correct this message :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrine said:
    be careful:

    Thanks - I know it probably seems mad - but the forum is set up as a group discussion for a finite set of professionals - very low traffic, very few posts - and no one ever pokes their head in to see what's going on. So, sending them email when a new discussion topic appears will make things work.

    Now to figure out where in the dbase those prefs are stored…I need to change the default pref for all the existing members!

  • peregrineperegrine MVP
    edited June 2012

    .

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • PamelaPamela ✭✭

    yofal said:
    So I see 8 sets here (email and pop-up), but checking "Advanced Notifications" adds two more (10) for every user that I'm not seeing above.

    Any ideas?

    because you 're admin :) may be

  • Pamela - no, they appear for other user types as well...

    8-)

  • peregrineperegrine MVP
    edited June 2012

    you have to set advance notifications for members in the dashboard to see.

    and possibly add
    $Configuration['Preferences']['Email']['NewDiscussion'] = '1';
    $Configuration['Preferences']['Email']['NewComment'] = '1';

    to config.php and possibly config.defaults.php

    and you might need to update all users manually as admin or change the preferences column and add

    a2:{"Email.NewDiscussion";s:1:"1";s:16:"Email.NewComment";s:1:"1";}

    or possibly

    a:9:{s:17:"Popup.WallComment";b:0;s:21:"Popup.ActivityComment";b:0;s:25:"Email.ConversationMessage";b:0;s:25:"Popup.ConversationMessage";b:0;s:21:"Email.BookmarkComment";b:0;s:23:"Popup.DiscussionComment";b:0;s:21:"Popup.BookmarkComment";b:0;s:19:"Email.NewDiscussion";s:1:"1";s:16:"Email.NewComment";s:1:"1";}

    and then have everybody verify what they want in their preferences.

    strange thing is - that these are the only two strings dealing with e-mail and the others are boolean - another mystery.

    this would be an example of setting only one of the advanced notifications.

    a:8:{s:17:"Popup.WallComment";b:0;s:21:"Popup.ActivityComment";b:0;s:25:"Email.ConversationMessage";b:0;s:25:"Popup.ConversationMessage";b:0;s:21:"Email.BookmarkComment";b:0;s:23:"Popup.DiscussionComment";b:0;s:21:"Popup.BookmarkComment";b:0;s:19:s:16:"Email.NewComment";s:1:"1";}

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Peregrine - I already had a set of predetermined settings for the standing 8 notification preferences…I was just look to set a desired preference for the extra two that checking "Advanced Notification" adds. I'm still not sure that we're looking at the correct naming for those two additional prefs.

    $Configuration['Preferences']['Email']['NewDiscussion'] = FALSE; 
    $Configuration['Preferences']['Email']['NewComment'] = FALSE; 
    

    The database aspect appeared when I realized I wasn't able to set the preference retroactively via prefs - it needs to be written into their user table.

  • peregrineperegrine MVP
    edited June 2012

    Either the naming is wrong or I don't think the 2 advanced notifications can be set from config.

    the only way I see you can do it is to modify the preference for each new user that registers.

    put your default settings in plus the two at the end.

     
    UPDATE `vanilla`.`GDN_User` SET `Preferences` = 'a:9:{s:17:"Popup.WallComment";s:1:"1";s:21:"Popup.ActivityComment";s:1:"1";s:25:"Email.ConversationMessage";b:0;s:25:"Popup.ConversationMessage";s:1:"1";s:21:"Email.BookmarkComment";b:0;s:23:"Popup.DiscussionComment";s:1:"1";s:21:"Popup.BookmarkComment";s:1:"1";s:19:"Email.NewDiscussion";s:1:"1";s:16:"Email.NewComment";s:1:"1";}' WHERE `UserID` > 
    

    and there are probably only a few people (I wonder who they might be) who can tell you whether they can be set from config.

    If a user changes even one preference the whole array of serialized data for all values is written

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • There is also something in the usermeta table

    Preferences.Email.NewDiscussion

    value 1 - sets it on

    I have no idea. One of my first discussions was questions about the user permissions and table values,etc and I asked for info and was met with silence. maybe you will have better luck.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • So I guess that brings me to the question - can I add a preference state to all members records? Most of them have not made any changes - but a few have. I'm fine to let them edit the preference state after the fact, but need them to have the option.

  • peregrineperegrine MVP
    edited June 2012 Answer ✓

    yes read the above messages on changing the database. BACKUP any tables you plan to change first.

    it looks like just changing the usermeta table is the way to do it.

    add users to usermeta with a value of 1 and Name Preferences.Email.NewDiscussion
    and a value of 1 and Preferences.Email.NewComment.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks Peregrine - I'll give it a shot!

  • yofalyofal New
    edited June 2012

    Hey Peregrine - it looks like meta is the way to do it. Thanks!

    Now the remaining problem seems to be setting these two prefs to TRUE for new users. Adding the lines discussed above to the config file did not work.

    So, one more nut to crack - any ideas? Perhaps the naming isn't correct - or perhaps those prefs don't hook into the config file…

    Anyone?

  • peregrineperegrine MVP
    edited June 2012

    Glad you "Liked" the other info. I've come to believe that there isn't a config option. I'm just one step ahead of you on this, so its all experimentation with me.

    An idea - but you will have to delve into the vodoo behind it.

    maybe something in the usercontroller
    
    add something
       Gdn::SQL()->Insert('UserMeta',array(
                      'UserID'    => $UID,
                      'Name'      => $Key,
                      'Value'     => $Value
                   ));
    
    after this event
    
      $this->FireEvent("AfterApproveUser");
    

    maybe Todd or x00 could shed some light.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited June 2012

    meanwhile you could try prefilling the next 50 userids with those fields in the usermeta table.

    add a test user and see if it works or breaks anything. let us know.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Hmmm…we're creating users manually and sending their credentials via email.

    Not sure how to "pre-fill" user IDs…good idea though.

  • peregrineperegrine MVP
    edited June 2012

    lets say you have 100 users in your user table.

    then you could add to user meta starting from 101 for a certain number of user.
    then to test a new user addition to see if it works.

            INSERT INTO `vanilla`.`GDN_UserMeta` (
            `UserID` ,
            `Name` ,
            `Value`
            )
            VALUES (
            '101', 'Preferences.Email.NewDiscussion', '1'
            );
    
          INSERT INTO `vanilla`.`GDN_UserMeta` (
            `UserID` ,
            `Name` ,
            `Value`
            )
            VALUES (
            '101', 'Preferences.Email.NewComment', '1'
            );
          ;
    
            INSERT INTO `vanilla`.`GDN_UserMeta` (
            `UserID` ,
            `Name` ,
            `Value`
            )
            VALUES (
            '102', 'Preferences.Email.NewDiscussion', '1'
            );
    
     INSERT INTO `vanilla`.`GDN_UserMeta` (
        `UserID` ,
        `Name` ,
        `Value`
        )
        VALUES (
        '102', 'Preferences.Email.NewComment', '1'
        );
    etc.
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.