HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Ok, one more question for today! Is there any way to subscribe to admins posts?

I'm sorry for flooding the forum with my posts 🀐 This is the last one for today, I promise 😁

So here is the question-

Is there any way to subscribe all members to the Admin's post? So when an Admin posts anything, all the members will get a notification (Email and pop up). It should be optional in the "Notification Preference" section, something like "Subscribe to admins post"?

Also, I would like to know if it will be heavy on the server if there are lot's of members like 10k? Will it work on a VPS server with 12GB ram and 6 core processor? Currently there are very few members, I'm just curious to know how it will affect the server load.

I would be happy to pay a small amount like $50 or so if it is possible, I know it's a very tiny amount, but this is what I can offer right now πŸ™‚

PM me if anyone wants to help.

Any help would be greatly appreciated.

Kind Regards

Comments

  • R_JR_J Ex-Fanboy Munich Moderator

    The problem with notifying everybody about something is that Vanilla works synchronously: every process step requires the previous one to be finished. So if you send out a mail after a post, that in the end will be 1. admin clicks post button, 2. server saves post, 3. server sends mails, 4. server sends back response (which includes showing the current post) to admin

    In case of sending that mail to a few members only, that would be no problem. But the more users your forum has, the bigger the risk is that your server times out which means that not all mails will be sent.

    So the better implementations for something like that include a queue or an external mail server. Both of which are quite complex to implement.

    For using some newsletter like functionality, you should think about dedicated solutions. In order to have that integrated in Vanilla a plugin which syncs your users email addresses with such a service would be best. If you think about spending money, do it that way! There is a plugin which you need to pay for, but it costs only the half of your budget:

    But I guess you need to pay fees for MailChimp, too.

    If you find an alternative to MailChimp which is cheaper or in any way better suited for your needs, you can ask the creator of that plugin if he would customize it for that provider. Don't know about costs for something like that, though.


    Concerning the server load: do you use memcached already? If not, you should. After that I wouldn't do anything more. I don't expect you will be able to raise your user numbers from "only a few" to 10k in a short time ;-) But if you do, you should definitely spent some bucks to ask a professional to tune your web server. That will not require a Vanilla expert but only someone who knows about webservers, caching, and so on


    testing3K17
  • Thank you so much for your detailed answer @R_J

    Here are some details about what we're using-

    1. All the members are our website customers synced to the forum by the Jsconnect plugin, so we don't need to collect the emails separately to send the emails, we're already using a dedicated self-hosted mail server with amazon SES to send the newsletter, so the above plugin is not necessary because we already sync all the customer's emails with our mail server. We just want to notify the forum members when an admin posts something new, it will increase the user engagement on the forum.
    2. We're using the Amazon SES with Vanilla to send all the outgoing emails, will it be concerned as an external mail server?
    3. And yes, we're using the Memcached and opcache. And I think implementing a queue functionality will do the job.

    And a plugin would be great to have this functionality, and It can be extended more and give the ability to all the members to subscribe to any other member to get notifications about their posts, more like a follow function? But it will surely be more complex, and I would like to go with the easy one. πŸ˜‰

    Thanks for your help, I greatly appreciate it ❀️

    Kind Regards.

  • Hi @R_J,

    Someone recently posted regarding this plugin-

    And if I'm understanding it correctly, if it sends an email to all members when I mark a post as an announcement, then it can be used to implement the functionality that I want.

    I have installed and enabled the plugin, all went well in the backend, I have given permission to the admins to use the plugin under the "Roles And Permissions" section in the dashboard.

    But I'm not seeing the option "EMail this discussion" checkbox when creating a discussion that sends an e-mail to all the users using the system.

    It's an old plugin, so that might be the problem, I'm using the latest Vanilla version 3.3.

    Could you please take a look at this plugin? Any help would be greatly appreciated.

    Kind Regards

  • R_JR_J Ex-Fanboy Munich Moderator

    I see two technical problems with that plugin. You should rename "default.php" into "class.emaildiscussion.plugin.php" and edit the line "class EMailDiscussion extends Gdn_Plugin {" into "class EMailDiscussionPlugin extends Gdn_Plugin {"

    Afterwards you have to delete "/cache/addon.php".

    There is room for improvements, though. The plugin sends mails to all users, including deleted and banned users. Furthermore instead of sending to [email protected] with bcc: all users, the plugin loops through all mail addresses and sends out one mail per user.

    I'm no lawyer, but I guess you need to include a possibility to opt out.


    testing3
  • Thank you so much for the solution, it worked and I'm able to see the checkbox.

    I have not tried it yet to see if it is actually sending the emails or not, because I don't want the members to feed the emails forcefully.

    I thought this plugin would be a good starting point to implement the functionality, and it must have an option to unsubscribe from the emails as you already mentioned.

    I think this solution could be implemented to exclude/unsubscribe users-

    I'm not a developer, so it is out of my scope, but if someone with coding knowledge guides me, then I can try to do it :)

    Thank you so much for your help, it means a lot to me.

    Kind Regards.

  • R_JR_J Ex-Fanboy Munich Moderator

    It's not the best example for a beginner plugin. But it's doable, but certainly only if you want to learn. I can give advices, but I will not write code for you.

    If you want to develop plugins, you need a test environment. That doesn't need to be a mirror of your live forum. Just some dummy users will be enught. The default Vanilla installation already provides 4 test users and that will be enough.

    If you are a linux user, then I guess you know how to install your test environment. If you are a windows I strongly recomment not using some WAMP stack. Your server is running on linux and so should your test server do. Either install Oracles VirtualBox and install some Linux inside. Linux Mint is really beginner friendly.

    I have become a fan of the "Windows Subsystem for Linux" (WSL). That allows installing a debian directly on your windows machine. But there is no graphical UI, only a command line. So it requires more Linux knowledge than the VirtualBox + Linux Mint setup.

    If you already have a WAMP stack set up, you can certainly go with it. But a plugin that works flawlessly on Windows, might not work on Linux or the other way around.


    If you have prepared the test forum, read the basics:

    https://success.vanillaforums.com/kb/articles/152-what-is-an-addon

    https://success.vanillaforums.com/kb/articles/151-the-addon-json-file

    https://success.vanillaforums.com/kb/articles/164-addon-quickstart-guide


    The most important task after this is to define the features the plugin should have:

    1. It should send mails

    2. after a discussion has been created

    3. by a person with special permissions

    4. but only to those who wants to be notified

    Correct? If not, add the missing tasks (one by one if possible)


    In one of the links above, there was one very, very important sentence "Download other addons from the Addon Directory and borrow their code.". You yhould take a look how all of the things have been done by others. That's the part where most beginners are lost. Therefore I gathered some examples for you. There are much more, so if you need more, try to find them wih a mighty tool like grep (or Notepad++) or ask and I will give hints on how to find more examples.

    Matching the numbers from above, here are the examples:

    1. https://github.com/vanilla/vanilla/blob/release/3.3/applications/dashboard/models/class.invitationmodel.php#L198

    2. https://success.vanillaforums.com/kb/articles/245-event-and-handlers

    3. https://success.vanillaforums.com/kb/articles/255-permission-checking

    4. https://github.com/R-J/kick/blob/master/KickPlugin.php, https://github.com/vanilla/vanilla/blob/release/3.3/applications/vanilla/models/class.discussionmodel.php#L2370


    Okay. That has been the preparation. But how to start now?

    Create a valid plugin with the following method:

    public function base_render_before($sender) {
    Β Β Β decho('useless');
    }
    

    If you have done everything correct and enable that plugin, as an admin you should see that debug message on every page call. A normal user should not. During the creation of a plugin, you might need to delete the /cache/addon.php file, because it might have cached incomplete addon meta data.


    After that you need to implement the features in the following order: 3., 4., 2., 1.

    Read about how to implement permissions, take a look at plugins which create their own permissions (the kick plugin does) and see if you can implement this. If you are at this point, ask again.

    Just to tell you my expectations as your teacher: if you are not able to make it this far, I'd say you have chosen the wrong class. But that should just serve as an estimation about the level of difficulty up to this point. Learning includes asking questions, so nevertheless please ask at any time.


    K17testing3
  • Thank you so much for the detailed instructions Rj,

    It will definitely help me and others who want to learn, I really appreciate your help and support.

    I'll try the instructions and get back soon with lot's of questions πŸ˜‰

    Kind Regards.

Sign In or Register to comment.