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.

No option to email discussion once posted

meadwaykmeadwayk New
edited March 2011 in Vanilla 2.0 - 2.8

I installed this plugin instead of using the 'emailsubscription' plugin, as I like the idea of starting a discussion (tips of the week, latest fault in our system etc) and have the ability to email all our users (as the admin). However I can see no option to do this, either before or after the discussion is posted. The description of the plugin kind of suggests that making the discussion an 'announcement' would send the email but this does nothing either!
I'm using the latest version of Vanilla2 and the plugin screen says its installed. There were errors during installation, and I also can see no options in the dashboard.
I have installed the 'email subscription' plugin as well, and this appears to work - options appear in users profiles and if the right category is selected, then users receive a notification to say there is a new post. However this is not quite what i was after, but I installed as I assumed some of the base code might be similar and to test it worked.

Any suggestions on how to resolve, so EmailDiscussion works? I've tried uninstalling and reinstalling, to no effect. This was the first plugin I installed after a clean install, so I'm at a loss as to whats going on...



  • Options
    any update to why I can't seem to use this plugin, as per previous message above? Would love to be able to use this, but can't find any option to do so...

  • Options
    Hello, @meadwayk . I haven't looked into this plugin for quite a while, but let me give it a try.

    The envisioned plan is to see a checkbox each time you create a new discussion that lets you send an email for that discussion.

    That checkbox is created only if the user that creates the discussion has

    By default, it gets activated only for the people who have the Administrator role, but you should be able to choose who gets these permissions by going to Dashboard -> Roles and Permissions -> __Role_of_choice__ and check the Plugins/EMailNotification checkbox there.

    Let me know if that works for you, otherwise, I can try more debugging.

  • Options
    Hi @cdavid

    thanks for responding. I have double checked and my admin role had the checkbox for EmailNotification within Roles and Permissions checked. i have unticked it, saved, and then reticked it, to no avail. I also tried the default theme, just in case, but this had no effect either.
    Happy to check any code, if I know what I'm looking for...

  • Options
    cdavidcdavid New
    edited April 2011
    Hi @meadwayk !

    Can you tell me what version of Vanilla are you using?

    Just to make sure that everything works, can you please transform the following code in the next following code?
    public function PostController_BeforeFormButtons_Handler(&$Sender) { $Session = Gdn::Session(); if($Session->CheckPermission('Plugins.EMailNotification.Send')) { if (in_array($Sender->RequestMethod, array('discussion', 'editdiscussion'))) { $FormValues = $Sender->EventArguments['FormPostValues']; echo "<ul class='PostOptions'><li>"; echo $Sender->Form->CheckBox('EMailDiscussion', T('EMail this discussion'), array('value' => '1')); echo "</li></ul>"; } } }
    public function PostController_BeforeFormButtons_Handler(&$Sender) { if (in_array($Sender->RequestMethod, array('discussion', 'editdiscussion'))) { $FormValues = $Sender->EventArguments['FormPostValues']; echo "<ul class='PostOptions'><li>"; echo $Sender->Form->CheckBox('EMailDiscussion', T('EMail this discussion'), array('value' => '1')); echo "</li></ul>"; } }

    in the default.php file and try to create a new discussion then (do you see the checkboxes now?)? Also make sure you undo the changes soon after checking...
    If you can see the checkboxes, then it's a permission problem and I'll look into it.

  • Options
    hi @cdavid

    I'm currently on vanilla

    Have tried changing the code above, and it has made no noticeable difference - certainly no check box appears when an admin tries to create a new discussion.

    Probably a red herring but i do have the 'fileupload' plugin enabled which adds another link on the create a discussion page - is this likely to interfere with your plugin due to the location of the link, and function to upload files?

    thanks in advance...
  • Options
    hi @meadwayk

    No, it should not interfere in any way...

    I'll look into this later on today on my computer, maybe something changed in Vanilla since I released it.

  • Options

    Many thanks for your continued help in resolving this issue. It's much appreciated!
  • Options
    Hi @meadwayk
    So, I tried it on my local installation and everything seems to work fine.

    Image and video hosting by TinyPic

    Here is a screenshot... and it does seem to work. I'm not sure what the problem might be...

  • Options
    Hi @cdavid,

    I've no idea why, but the voting plugin has this in its voting.css:
    line 224:
    Form_Discussion ul.PostOptions {
    display: none;

    When I comment out the display:none the email this discussion option suddenly appears along with an option to announce or close the discussion - I've never seen those before!

    Any ideas why this would happen? maybe a cross over of css naming? I've moved a copy of the voting.css into my theme folder (for my current theme) if that helps..
  • Options
    Hello, @meadwayk

    Hmm, weird indeed...

    Then you should comment it out for now, make sure you have the latest version of the Voting plugin and report a bug to the developer.

  • Options
    Hi @cdavid

    have raised a bug with the voting developer about the conflicting css

    have now been able to test your plugin, and I have a couple of other questions:
    It appears members can see the tick box on the 'start a discussion' page, and can email their discussion as well. This is even though I definitely only have the plugin enabled for Admins only (It seems all user groups have the ability to see the tick box, which is obviously not correct)

    second, I'm trying to edit the resulting email to include the discussion title but I don't know what the database tag is I need to add. Would you know? For example to display the posters name you use $Name and the link contains $DiscussionID to help point to the correct post in the forum, but I tried $DiscussionName and $Story, and neither worked!
    I found an old discussion about this, but the code example suggested did not match up with what is in the current default.php

  • Options
    I've sorted out the second question above, about adding the discussion title/body text to the email sent to users, but I'm still having issues with the check box appearing on the create a discussion page. Answering my second question was pushing the limits of my php 'skills', so I've no idea how to sort the security bit!
    If anyone has any suggestions, it would be much appreciated....
  • Options
    Hmm... are you sure you reverted the code I told you to modify above?
    e.g.: make sure the code has $Session = Gdn::Session(); if($Session->CheckPermission('Plugins.EMailNotification.Send')) { ?
  • Options
    hi @cdavid

    Many thanks for checking again. I understand from other posts from you to other people you are extremely busy at the moment!
    Have checked the code, and I had not reverted back to the old code that should have been in place, although I thought I had rolled back after initially testing. Anyway, I have now changed the code back, and the check box disappears for all users except admin!

    thanks again...
  • Options
    DenisSDenisS My brain hurts Buriram ✭✭

    Hello cdavid and meadwayk. I use the email subscribe and works great and just sending the Discussion Title, works great. I the same as meadwayk I can't seem to get this Email discussion to work the check box is there all looks correct. But don't send the email, was there a fix? I know this is last year and see nothing since. But i really like this plugin.

Sign In or Register to comment.