Needs review
Project:
Signup
Version:
6.x-1.0
Component:
CCK Date integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2011 at 22:28 UTC
Updated:
7 Oct 2011 at 22:28 UTC
I created a content type with a cck date field and enabled the functionality of repetition. When I created a node of this type, I put granularity as "day" and told to repeat the event for the next 5 days. When the cron ran, I received 5 emails warning. To fix this, I made a small change in file includes/cron.inc close to the line 57.
I've just modified it:
while ($signup = db_fetch_object($signups)) {
$user_mail = _signup_get_email($signup);
$params = array(
'subject' => $subject,
'body' => $node->reminder_email,
'node' => $node,
'signup' => $signup,
);
for this:
while ($signup = db_fetch_object($signups)) {
$user_mail = _signup_get_email($signup);
// send only one email per user
if (in_array($user_mail, $nodes[$node->nid])) {
continue;
}
$nodes[$node->nid][] = $user_mail;
$params = array(
'subject' => $subject,
'body' => $node->reminder_email,
'node' => $node,
'signup' => $signup,
);
Hope that helps on something.