Email notification of comments

Is there a way to get typo to send you an email anytime someone posts a
comment on my blog?

On Thursday 17 August 2006 22:20, Phillip T. wrote:

On 8/17/06, Paul B. [email protected] wrote:

Is there a way to get typo to send you an email anytime someone posts a
comment on my blog?

There is in version 4.0.x. Click on the Users tab in the Typo admin
screen and then edit your user account. There are options for sending
notifications via Jabber and email.

Though currently it doesn’t seem to call the code that actually sends
the
message… that is, unless that’s been fixed in the past 24 hours or so.

TX

On 8/17/06, Paul B. [email protected] wrote:

Is there a way to get typo to send you an email anytime someone posts a
comment on my blog?

There is in version 4.0.x. Click on the Users tab in the Typo admin
screen and then edit your user account. There are options for sending
notifications via Jabber and email.

Phil

On 8/17/06, Trejkaz [email protected] wrote:

message… that is, unless that’s been fixed in the past 24 hours or so.
I am running Typo 4.0.2 and both Jabber and email notifications work for
me.

Trejkaz,

You need to set up your mail server information in config/mail.yml for
email notification to work. See mail.yml.example for the format of
the file. Hope this helps.

-Jason

Trejkaz,

You need to set up your mail server information in config/mail.yml for
email notification to work. See mail.yml.example for the format of
the file. Hope this helps.

I don’t particularly care about mail notifications as I’ve only ever
used
the Jabber notifications. But I’ve put a breakpoint in the function
that
sends Jabber notifications and that breakpoint is never reached. See my
previous mail to this list for further details; I actually put
breakpoints
in a huge number of places and found that the method which iterates over
the users to see if they want notifications isn’t even being called.

Incidentally I’m talking about trunk here. It’s possible that 4.0.x
works
and then a bug was introduced on trunk after it was branched.

TX

Trejkaz,

You need to set up your mail server information in config/mail.yml for
email notification to work. See mail.yml.example for the format of
the file. Hope this helps.

I don’t particularly care about mail notifications as I’ve only ever used
the Jabber notifications.

Also FWIW, I just configured mail.yml on my local development copy
(using
smtp to my local server) and those aren’t being sent out either.

If I send through the console using article.comments.create!, I can at
least see this in the log:

User Load (0.000735) SELECT * FROM users WHERE (notify_on_comments =
1)

And indeed the notifications then work.

I would do a bit more research but I’m not entirely sure where I should
be
looking. My naive guess is that this is somehow related to the new
state
changing code, and perhaps the state of a piece of content changes
differently depending on whether it was created through the frontend or
the console.

TX

On 8/17/06, Trejkaz [email protected] wrote:

smtp to my local server) and those aren’t being sent out either.
changing code, and perhaps the state of a piece of content changes
differently depending on whether it was created through the frontend or
the console.

Fun :-(. Well, email notifications work for me. If you can find a
fix then I’ll roll it up into 4.0.4.

Scott

On 8/17/06, Trejkaz [email protected] wrote:

in a huge number of places and found that the method which iterates over
the users to see if they want notifications isn’t even being called.

Incidentally I’m talking about trunk here. It’s possible that 4.0.x works
and then a bug was introduced on trunk after it was branched.

Hmm. Mail notifications work for me. The jabber ones used to work
for me, but I haven’t retested. I’ll work on them once I’ve finished
merging my big block of 4.1 code.

The current trunk (r1230) is still 4.0.x; 4.0.3 will be out in a few
minutes. I’m going to build a maintenance branch for 4.0.x soon, but
it hasn’t happened yet.

Scott

Fun :-(. Well, email notifications work for me. If you can find a
fix then I’ll roll it up into 4.0.4.

Okay, I just did a web request and a console request and snipped the
state
changes out of the logs of both for the purpose of comparison.

Here’s what happens during a web request:

#Comment:0xb6ef4fd0 leaving state ContentState::New
#Comment:0xb6ef4fd0 entering state ContentState::Unclassified
#Comment:0xb6ef61a0 leaving state ContentState::New
#Comment:0xb6ef61a0 entering state ContentState::Published
#Comment:0xb6ef61a0 leaving state ContentState::Published
#Comment:0xb6ef61a0 entering state ContentState::Unclassified
#Comment:0xb6ef61a0 leaving state ContentState::Unclassified
#Comment:0xb6ef61a0 entering state Content::JustPresumedHam
#Comment:0xb6ef61a0 leaving state Content::JustPresumedHam
#Comment:0xb6ef61a0 entering state ContentState::PresumedHam

And here’s a comment sent manually through the console:

#Comment:0xb7579d40 leaving state ContentState::New
#Comment:0xb7579d40 entering state ContentState::Unclassified
#Comment:0xb7596a58 leaving state ContentState::New
#Comment:0xb7596a58 entering state ContentState::Unclassified
#Comment:0xb7596a58 leaving state ContentState::Unclassified
#Comment:0xb7596a58 entering state Content::JustPresumedHam
(NOTIFICATIONS BEING SENT HERE)
#Comment:0xb7596a58 leaving state Content::JustPresumedHam
#Comment:0xb7596a58 entering state ContentState::PresumedHam

What’s most interesting to me is how the console version never becomes
“published”, and yet it’s the only one where the notifications are sent.

TX

In typo 4.0.2, neither email or trackbacks work for me. Well, they
don’t
work using webrick, and they very rarely work using fcgi. I have
tracked it
down to a problem in rails and the Dispatch code. Basically, observers
are
not restored correctly after Dispatcher::reset_application! Depending
on
your setup (lighttpd, webrick, fcgi) and how it uses the dispatcher, you
may
or may not be affected since the first time your go through the
dispatcher,
everything works fine, but the subsequent times, the observers are gone,
so
no email or no trackbacks. If you are lucky to get a new ruby instance,
it
works.

The way to workaround this is to setup your observers in
ApplicationController instead of environment.rb adding this line to the
app/controllers/application.rb:

observer :content_observer, :email_notifier, :web_notifier

I’m still testing the patch before I use it on my site and I’m guessing
that’s probably an oversight from the rails code, but the workaround
seems
to work for me.

Pascal
http://blog.nanorails.com

The way to workaround this is to setup your observers in
ApplicationController instead of environment.rb adding this line to the
app/controllers/application.rb:

observer :content_observer, :email_notifier, :web_notifier

I’m still testing the patch before I use it on my site and I’m guessing
that’s probably an oversight from the rails code, but the workaround seems
to work for me.

Hey, works for me too! Thanks for that. :slight_smile:

FWIW, I’m using Mongrel to run my development instance. I use FastCGI
for
production still because I’m too lazy to reconfigure my Apache.

TX

Good to hear it works in your case too. Time to enter a patch in trac.
I
also have a few tweaks to trackbacks and pingbacks as each one uses 2
threads while one would be plenty.

That fix is deceptivly simple but it took me long hours to track it
down.
The best part of it, though, is that I now have a much better
understanding
of rails observers, dependencies, dispatching and initialization code.
And
I learned quite a bit on the internals of typo too. :slight_smile:

I wish I could use mongrel as well, but with DreamHost, I’m stuck with
fcgi. Not for lack of trying various sneaky ways, but so far no luck.
Their setup of apache is just too locked down.

Pascal
http://blog.nanorails.com

Pascal Belloncle wrote:

I wish I could use mongrel as well, but with DreamHost, I’m stuck with
fcgi.

What do you see as superior about Mongrel as opposed to FCGI?

mathew

We are on TextDrive.com and using Mongrel (and quite happy with them)
-Linda

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs