Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

Modify EmailDiscussion addon to exclude certain users from receiving the emails?

Hi:

Presently the EmailDiscussion plugin sends out emails to all users by default. I want to modify it to exclude certain users from receiving the emails. So, I will modify the body of the email with verbiage like "To unsubscribe from these emails, reply with REMOVE in the subject line." Then, if a user replies asking to be removed, I want to update the EmailDiscussion plugin, perhaps updating config.php directly, to exclude that user/email address.

I'm running 2.1.11.

Any input is greatly appreciated!

Comments

  • peregrineperegrine MVP
    edited October 2015

    You should go to the plugin in question and choose ask question from the plugin page.
    in the future so it is tied to the plugin and easier for other to see.

    when asking a question about a specific theme, plugin, application or locale.

    please go to

    http://vanillaforums.org/addons

    • choose the add-on which you have a question about.
    • select "ask a question"

    you will see this on all add-ons....


    there is a foreach loop that cycles through the users.

    you can skip the rest of the loop if the name is in an array

    http://stackoverflow.com/questions/3847704/getting-foreach-to-skip-over-iterations

    to help yourself modify the plugin.

    look at php tutorials for arrays.

    http://www.w3schools.com/php/func_array_in_array.asp

    then check user against array list of excluded users that can be read from the config.php.

    pseudocode

    //get array of excluded users from config.php
    $excludedusers =C('Plugins.EmailSubscribe.ExcludeList');

    for each loop of user names

    if userx is in array of excluded users skip rest of loop

           email user (non-excluded users)
    

    end loop

    then in config.php

    you could put names in array.

    $Configuration['Plugins']['EmailSubscribe']['ExcludeList']= array('joe', 'bob', 'care', 'bama');

    if after you make all the necessary changes to plugin and post your changes someone might be able to debug if you have issue.

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

    ObamaCare_Forums
  • Hi @peregrine:

    Is that Greek or Chinese?

    In all seriousness, I'm not a developer so I have about a 0% chance of accomplishing this. Would you do it for me for a fee, or is their another developer in this forum that would do it? I think I have a good motive in trying to modify the add-on so it is spam compliant if that's worth any points :)

    Thank you,
    Bob H.

  • peregrineperegrine MVP
    edited October 2015

    obamacare said: Is that Greek or Chinese?
    In all seriousness, I'm not a developer so I have about a 0% chance of >accomplishing this. Would you do it for me for a fee, or is their another developer in this forum that would do it?

    Sorry. I don't do paid consulting anymore. I just give a suggestion or two to people who have the time and who might be eager, willing, and able to learn (and they can choose to run with it or not). But i'm sure there are other people who might be eager to provide code changes or a new plugin.

    In any event I looked at the wrong email plugin

    But you would be smarter if you posted question under the plugin

    The other option is the advanced notifications (numerous discussions about it) built into vanilla, but that is a opt-in rather than opt-out. I much prefer opt-in than opt-out so people don't get spammed.

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

    ObamaCare_Forums
Sign In or Register to comment.