The activity log digests aren't working for me with the latest dev... Nothing in the logs, nothing in the mail server logs, cronjob is properly configured, notifications/subscriptions all working fine... but not digests.

Tried changing to site timezone, still nothing... Looked through the other closed tickets and tried saving the profile... no joy.

Comments

icecreamyou’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure there's actually activity to send? Digests contain activity from the previous day. If you just create some content and then run cron right afterwards you're not going to get anything... you need to wait awhile.

lightsurge’s picture

>3 weeks, no digests, see #1292122: Email digests not being sent

lightsurge’s picture

Status: Postponed (maintainer needs more info) » Active
lightsurge’s picture

I'm looking at trying this module: http://drupal.org/project/simplenews_scheduler

Using this along with Rules and http://drupal.org/project/insert_view I figure a solution might be possible which might be easier to maintain/administer.

Basically the workflow might be User registers -> Rules creates a newsletter node with an inserted view customised to the user -> Add a link to the node on the profile page.

insert_view is only minimally maintained though, and obviously will be more painful dealing with pre-existing users.

Edit: Actually, no reason I'd need to use insert_view, no particular reason if we can just call views_embed_view in a php node.

icecreamyou’s picture

Creative, but it's a lot more complicated than that. Actually sending the emails regularly is the easy part. It's the collecting and rendering activity messages that's hard and it requires custom processing that can't take advantage of Views.

lightsurge’s picture

I explored this yesterday and it looked like it would work to some extent, but would require a separate simplenews node per user, and therefore a triggering a separate query, which made it seem a lot less elegant than this.

Even if I was to use a method with simplenews I've discovered I'd be no better off because the problem with digests seems related to the Rules that are supposed to be putting activity in the email digest logs... #1292122: Email digests not being sent and I can't work out what's going wrong there.

icecreamyou’s picture

Category: support » bug
Status: Active » Needs review

Committed a fix to Activity Log dev that I think should resolve this. Please try the latest dev once the tarball is generated and mark this issue "fixed" if it works.

lightsurge’s picture

This definitely seems to have fixed the output of the activities view when set to email digests... will see if I start getting digests emailed out tomorrow.

lightsurge’s picture

One thing I am seeing now though is multiple 'joined group' stream messsages in different formulations.

e.g.:
user 1 joined groups A, B, and C
user 1 joined groups C, A, and B
user 1 joined groups B, C and A
etc etc

I think this might be related to the regeneration of activity logs rather than this fix though... so where previously there might have been 5 joined group stream messages scattered throughout a user stream referring to individual groups joined, after regeneration there remains 5 individual messages, but these contain all the groups the user has joined, and they all go to the top of the stream.

icecreamyou’s picture

Status: Needs review » Fixed

That's a different issue and can be addressed in a different thread... should only be related to regeneration.

lightsurge’s picture

Status: Fixed » Active

Still no digests, so possibly there are two issues here, one actually producing the email digests which looks now fixed, and another in gathering/sending the digests.

I'm still getting database.inc errors on cron, so that might be related. I don't know how to getter better information out of the error log unless I install something like the supercron module which might be more helpful.

lightsurge’s picture

Just as an update, I'm now seeing digests sending out some information... but only to 2 (out of 50) users (despite all new content being in one group which all are members of)... and the odd behaviour gets even odder, it only sends out information belonging to the receiving user, i.e., it tells the user what they did yesterday, but nothing about what other people are doing.

So user A sees all the group status updates, nodes etc that they've submitted to a group, as well as all groups they've recently joined, but nothing of other users.

At this point for me I think digests has to go off, if digests starts sending out this meaningless information to other users, they're going to switch it off before it shows its usefulness. A great little newsletter module, shame it's not working, for intranet sites it's crucial I think because people won't bother logging in unless they know there's new relevant material on there for them to see.

lightsurge’s picture

taking advice from #1257754: Users not subscribed to digest unless they submit digest settings form and updating to dev version of digests http://drupal.org/node/1292118#comment-5053584 my users still weren't getting (sensible) digests.

I do now have digests, but not with the digests module, instead I

  • manually patched against the latest 1.x version of simplenews using the advice here #700308: Allow separate theming of each individual outgoing email instead of caching the prepared newsletter
  • cloned the activity stream view with filters to reduce streams to activity 'yesterday', and make the view empty if no argument
  • edited the simplenews 1.x email body theme template to impersonate the receiving user (using $account-mail given by above patch to get the uid for the receiving user through user_load) and following advice from http://drupal.org/node/218104
  • use views_embed_view to embed the cloned 'user' stream in the email body theme with $user->uid argument, as well as using the $user object to add other information to the template including name
  • because I'm using a private file system, implemented a hook_views_post_render to elimate img tags from the view
  • added a tag to the view if it was empty
  • modified simplenews.module so that it used above tag to not send out an empty email or attempt to re-spool it
  • installed latest simplenews scheduler 1.x
  • created newsletters based on Daily (but this setup could be adapted to also include weekly/monthly newsletters
  • installed http://drupal.org/project/simplenews_register to allow users to choose a newsletter on register
  • uninstalled digest module

I'm actually finding although this method is probably much more cpu-intensive (in terms of simplenews at least), even with my test user-base of >50 users I'm only seeing a few seconds to process all emails which I'm okay with. And I'm getting beautiful digests at last, so I'm happy, and my user-base get emailed there's new content to see, as I promised!

This will do me until the digests module is fixed.

icecreamyou’s picture

Status: Active » Needs review

I believe this commit should fix it. Can anyone confirm? Obviously this is kind of difficult to test, but this fix gets rid of an error that stops the "send" loop from running. (Originally posted here... but meant to keep this in the Activity Log thread.)

ezra-g’s picture

Given that it's unlikely that this commit will make things less broken than not sending digests, I suggest that it get committed and tested in dev or a new release :).

icecreamyou’s picture

It's already committed to dev...

ezra-g’s picture

Sorry, I was confused by the "needs review" status of this issue since typically it's used to refer to issues that don't yet have a commit.

icecreamyou’s picture

Status: Needs review » Fixed

Marking this as fixed. Although I haven't tested it in depth enough to know for sure that it's fixed, the fix in #1259944: Add a "send digest emails now" button basically overrides this one.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.