| 1 |
Elgg Broadcast Plugin |
|---|
| 2 |
Version 0.1 |
|---|
| 3 |
7 March 2008 |
|---|
| 4 |
For Elgg 0.9 |
|---|
| 5 |
|
|---|
| 6 |
Kevin Jardine |
|---|
| 7 |
Radagast Solutions |
|---|
| 8 |
http://radagast.biz |
|---|
| 9 |
kevin@radagast.biz |
|---|
| 10 |
|
|---|
| 11 |
Based on the newsletter plugin from Tim Hawes, and extensively re-written. |
|---|
| 12 |
Enhancement idea and funding by Jossi Fresco <jossif@mac.com>. Thanks Jossi! |
|---|
| 13 |
|
|---|
| 14 |
This plugin allows admins to send text or HTML messages to all or a subset |
|---|
| 15 |
of registered users. In addition, community owners can be allowed to message |
|---|
| 16 |
all or a subset of community members. Broadcasters can optionally restrict |
|---|
| 17 |
the messages to users with a specified profile field value or keyword. |
|---|
| 18 |
|
|---|
| 19 |
Whether community owners get to message their members is determined by the |
|---|
| 20 |
|
|---|
| 21 |
$broadcast_allow_owners |
|---|
| 22 |
|
|---|
| 23 |
parameter in boradcast.config.php |
|---|
| 24 |
|
|---|
| 25 |
This is set to true by default. |
|---|
| 26 |
|
|---|
| 27 |
If this is true, a "Broadcast" option appears in the community profile sidebar |
|---|
| 28 |
if viewed by community owners. This option always appears for admins. |
|---|
| 29 |
|
|---|
| 30 |
This plugin should only be used to message a fairly small group of users |
|---|
| 31 |
(less than 100). For larger groups, consider using the phplist plugin also |
|---|
| 32 |
available from the Elgg plugin repository. |
|---|
| 33 |
|
|---|
| 34 |
The plugin notifies all users and emails to those with the email notification |
|---|
| 35 |
preference set to true. Notice that this is different from the newsletter |
|---|
| 36 |
plugin, which emails to all users with the email notification not set to false. |
|---|
| 37 |
(That is, users who have not explicitly turned off email notification.) |
|---|
| 38 |
The broadcast plugin behaviour is a bit more Elgg-like. You can use the |
|---|
| 39 |
newuser plugin to set email notification to true for new users if you want |
|---|
| 40 |
to do that. |
|---|
| 41 |
|
|---|
| 42 |
Regardless of email notification status, all users receive web notification, |
|---|
| 43 |
which appears on the Your Activity page, and in private messages if the |
|---|
| 44 |
messages plugin is installed. |
|---|
| 45 |
|
|---|
| 46 |
The Elgg 0.9 email_to_user function in lib/elgglib.php |
|---|
| 47 |
does not allow HTML email messages. This is easy to change. |
|---|
| 48 |
|
|---|
| 49 |
Here's the patch: |
|---|
| 50 |
|
|---|
| 51 |
--- elgglib.php.orig Thu Feb 14 16:28:55 2008 |
|---|
| 52 |
+++ elgglib.php Thu Feb 28 18:53:03 2008 |
|---|
| 53 |
@@ -548,8 +548,9 @@ |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
//TODO add a user preference for this. right now just send plaintext |
|---|
| 57 |
- $user->mailformat = 0; |
|---|
| 58 |
- if ($messagehtml && $user->mailformat == 1) { // Don't ever send HTML to users who don't want it |
|---|
| 59 |
+ // KJ - really a bit extreme to forbid HTML in emails |
|---|
| 60 |
+ //$user->mailformat = 0; |
|---|
| 61 |
+ if ($messagehtml) { |
|---|
| 62 |
$mail->IsHTML(true); |
|---|
| 63 |
$mail->Encoding = 'quoted-printable'; // Encoding to use |
|---|
| 64 |
$mail->Body = $messagehtml; |
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
Comments, bug reports and suggestions for improvements are always welcome. |
|---|
| 68 |
Please send them to kevin@radagast.biz |
|---|