Open alisanta opened 2 years ago
Hi @alisanta and @souramoo ! I'm also interested in this feature.
Or more elegant way is to add auto-subscribe checkbox during user registration.
I think this would be the best solution. For now I'm considering to manually add a SQL trigger to set the sendreplynotifications
to true
when a user is added, but this isn't very user friendly.
Also, @souramoo , is this repo still active or should people considering forking or moving to a new project? The last commit was almost a year ago.
I would appreciate some help with this trigger + function. I'm trying to simply set the sendreplynotifications
to true
when a new row is inserted, but the trigger doesn't do anything:
CREATE OR REPLACE FUNCTION public.set_sendreplynotifications_true()
RETURNS trigger
LANGUAGE 'plpgsql'
COST 100
VOLATILE NOT LEAKPROOF
AS $BODY$
BEGIN
NEW.sendreplynotifications = true;
RETURN NEW;
END;
$BODY$;
ALTER FUNCTION public.set_sendreplynotifications_true()
OWNER TO commento;
CREATE TRIGGER set_sendreplynotifications_true_trigger
AFTER INSERT
ON public.emails
FOR EACH ROW
EXECUTE FUNCTION public.set_sendreplynotifications_true();
-- This doesn't set the value to TRUE
INSERT INTO public.emails (email, unsubscribesecrethex, lastemailnotificationdate, pendingemails)
VALUES ('test@example.com', 'secret123', NOW(), 2);
Fixed!
The trigger needs to be adjusted to the following:
CREATE TRIGGER set_sendreplynotifications_true_trigger
BEFORE INSERT
ON public.emails
FOR EACH ROW
EXECUTE FUNCTION public.set_sendreplynotifications_true();
First, thanks for your hardwork and all contributors.
As mostly disqus (or other systems) users may expect, the behaviour of new comment from new user is to 'always receive' email notification when someone reply their comment. Later they would unsubscribe if they found the thread becomes noisy.
I know that the fastest way is to change default value of 'sendreplynotifications' column in 'emails' table. Second alternative is to modify the row creation in the code. Or more elegant way is to add auto-subscribe checkbox during user registration.
Any inputs, much appreciated.