sorry for my english...
I need to disable email notifications permanently,eg for internal messages, comments, new entries,etc ... and just leave it enabled to recover passwords, registration form and invite friends ...how do we do?
Recently I saw a plugin that disables the default option for email notifications but only works when a user signs up on the site later if he or she activates the option, the administrator can not disable it, at least not cleanly ...
use: elgg 1.7.15, and the plugin of Cash phpMailer
For example if i have 300 active users and use gmail smtp...
in less than 4 hours I'll get to daily limit, and users who register or request new password do not come to the email .. = (
do you understand me?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- DevCreative@Testr
DevCreative - 0 likes
Matt is the first thing I did,(I look in the references) not post it because I blocked the mail in general, registration form and request a new password
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- DevCreative@Testr
DevCreative - 0 likes
I think I found a quick and simple solution but ignoring usability xD I put "site" default in notify_user ... the trouble is that it ignores the user preference but I did not want was to spend on email resources ... is what I found most acceptable given my low quality of programming, I hope some day, to know this as you! jejej
- Parixit@parixit
Parixit - 0 likes
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- Parixit@parixit
Parixit - 0 likes
- Parixit@parixit
Parixit - 0 likes
You must log in to post replies.unregister_notification_handler('email')
I don't know if that will affect password recovery (I would hope not) you may need to test it.
In that case you can hook into the email hook and prevent all non-registration/forgot password emails.
It's messier and you'll probably have to do something to remove the email option from user settings.
/**
* Notify a user via their preferences. * * @param mixed $to Either a guid or an array of guid's to notify. * @param int $from GUID of the sender, which may be a user, site or object. * @param string $subject Message subject. * @param string $message Message body. * @param array $params Misc additional parameters specific to various methods. * @param mixed $methods_override A string, or an array of strings specifying the delivery methods to use - or leave blank * for delivery using the user's chosen delivery methods. * @return array Compound array of each delivery user/delivery method's success or failure. * @throws NotificationException */ function notify_user($to, $from, $subject, $message, array $params = NULL, $methods_override = "site") { global $NOTIFICATION_HANDLERS, $CONFIG; // Sanitise if (!is_array($to)) { $to = array((int)$to); } $from = (int)$from; //$subject = sanitise_string($subject); // Get notification methods if (($methods_override) && (!is_array($methods_override))) {
$methods_override = array($methods_override);
@DevCreative I like your approch. I am going to use this. Thanks a lot.
http://docs.elgg.org/wiki/Dont_Modify_Core
@Matt I understand but I dont get other option to do that. Please advise.
@Matt and @DevCreative
I have reverted back changes in core file. And use following plugin and its great.
http://community.elgg.org/plugins/869366/1.8.2/elgg-18-set-no-notifications