I've released it at 0.9 because I've removed some functionality that wasn't logical.
Originally I had a plugin configuration option "send_help_email", and with this a "help_email" (address) configuration option. So the admin has the choice of whether a help email is sent to the existing users, and new users, to explain that they will receive email notifications, and they can turn this off in their profile page. However, this is only sent if the admin has allowed the user to have control over whether they receive email notifications.
It sounds good but there are logic problems. This is what happens:
- Admin activates the plugin. On activation, all users can control whether they receive email notifications.
- Plugin sends help email to all existing users.
- Admin then immediately switches off users' control over email notifications.
So existing users get an email saying they can change the notification settings in their profile, but actually they can't.
This is also a problem if later the admin turns off users' control over email notifications, but it's worse in the situation above. I have to think about when, in the code, I should attempt to send the help emails for existing users (it's not really a problem for new users). Anyway, I'll probably save this for version 1.0 or 1.1.
The other functionality I want to add is setting whether to send HTML or plain text emails. Right now it's plain text, but to get the body of the post or comment in the email, I've had to use PHP's strip_tags to remove all HTML tags (probably only going to be in posts, but they certainly can turn up in comments too). I'll add this for version 1.0.
Where I am using this plugin there have been problems with the emails - they were turning up on the mail client with the headers and content all displayed in the email. This is using Microsoft Exchange Server. The culprit (maybe?) seems to be the headers I've added:
"MIME-Version" => "1.0" "Content-type" => "text/plain; charset=utf-8" "Content-Transfer-Encoding" => "8bit"
My initial work around was to remove these headers and send only the From header.
[Update: I can see what the problem is now. Each line of the email being sent from habari/PHP (including the headers) is being sent as having TWO line breaks (so a line of text, then an empty line). Explanation and solution (use PHP_EOL instead of \r\n to separate headers) at the bottom of this page.]
0 Responses to Notify All plugin
Leave a Reply