Okay, then I'm relieved to see I'm not the only one with problems... :P
Since I did extensive rewrites of the system, I guess I have a correct understanding of it, so to make everything clear, it all boils down to three structures:
- the Notification object, holds a single notification for a member, a certain type. It provides methods that give low-level access to the notification's ID, type, etc.
- the Notifier object, is a 'generic' notification type, which provides plenty of default higher-level methods for a notification plugin (getEmail, etc.)
- the plugin's notifier, inherited from Notifier, called through issue().
Basically, a Notification object always has an associated Notifier.
If you get that, you're already halfway through the system.
Which is, err... Pretty much where I am, lol.
Anyway, I've made a few changes to John's suggestion, and will commit these. Unfortunately, I'm not bothered enough to test my changes, so... Hopefully it works, ah ah.
Code: [Select]
(getEmail only has one parameter now, because I removed $email_data, which doesn't have any purpose, and thus 'gets in the way', IMHO...)
Since I did extensive rewrites of the system, I guess I have a correct understanding of it, so to make everything clear, it all boils down to three structures:
- the Notification object, holds a single notification for a member, a certain type. It provides methods that give low-level access to the notification's ID, type, etc.
- the Notifier object, is a 'generic' notification type, which provides plenty of default higher-level methods for a notification plugin (getEmail, etc.)
- the plugin's notifier, inherited from Notifier, called through issue().
Basically, a Notification object always has an associated Notifier.
If you get that, you're already halfway through the system.
Which is, err... Pretty much where I am, lol.
Anyway, I've made a few changes to John's suggestion, and will commit these. Unfortunately, I'm not bothered enough to test my changes, so... Hopefully it works, ah ah.
foreach ($notifications as $notifier_name => $notifs)
{
$notifier = weNotif::getNotifiers($notifier_name);
list ($title) = $notifier->getProfile($notifs);
$str .= "\n" . $title . "\n" . str_repeat('=', strlen($title)) . "\n";
foreach ($notifs as $n)
{
list (, $body) = $notifier->getEmail($n);
$str .= $body . "\n\n";
}
}
(getEmail only has one parameter now, because I removed $email_data, which doesn't have any purpose, and thus 'gets in the way', IMHO...)