Giter VIP home page Giter VIP logo

Comments (1)

xmarcux avatar xmarcux commented on June 12, 2024

I have made a hackish solution for notification mails even if user has not read the post.
User will receive mails for all replies on post even if post is not read if "Lurk" has been chosen for the tag.
I include a patch file if somebody else is interested:
obsess.txt

To run the patch file:

  • Have this extension installed
  • Go to root flarum directory
  • Run: patch -p0 <obsess.txt

What is changed is the sql that searches for users in file: SendNotificationWhenReplyIsPosted.php
on line: 62-74
The replacement sql is:

        $notify = User::select('users.*')
            ->where('users.id', '!=', $this->post->user_id)
            ->join('tag_user', 'tag_user.user_id', '=', 'users.id')
            ->whereIn('tag_user.tag_id', $tagIds->all())
            ->whereIn('tag_user.subscription', ['lurk'])
            ->get()
            ->reject(function (User $user) use ($tags) {
                return $tags->map->stateFor($user)->map->subscription->contains('ignore')
                    || !$this->post->isVisibleTo($user);
            });

It starts on this line:
https://github.com/FriendsOfFlarum/follow-tags/blob/master/src/Jobs/SendNotificationWhenReplyIsPosted.php#L62

As I am not a php developer I will not be able create a full change for this feature and add a merge request.
Hope this could be useful to somebody else.

from follow-tags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.