[1.10.x] emailing registered users

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> b2evolution Support
View previous topic :: View next topic  
Author Message
adriscoll
Seasoned Poster
Seasoned Poster

Joined: 31 May 2007
Posts: 75
Reputation: 18.5Reputation: 18.5 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Fri Aug 15, 2008 12:38    Post subject: [1.10.x] emailing registered users Reply with quote

My b2evolution Version: 1.10.x

is there a way to send out a blanket email to all registered users?

If so, is there a way to do it by user type? i would like to send some updates, like a newsletter, to all of the bloggers on my community.

I have looked at the database and found the user table but it only has name and login.
Back to top
View user's profile Send private message
tilqicom
Guru
Guru

Joined: 14 Nov 2007
Posts: 1624
Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 20

PostPosted: Fri Aug 15, 2008 13:16    Post subject: Reply with quote

it's the first time i wont advise advise someone to perform a search : P i remember myself asking Afwas about this one on Irc, he has mentioned there was a similar post back than, i just had the time to make a quick search however i found nothing but related topics redirecting into each other.. maybe someone would provide the exact link to the solution that i couldnt find and cannot point to atm..But fyr.; it's doable ofc.. good luck in advance
_________________


.: linkback ≠ spam, yes to linkback, no to spam Shy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
adriscoll
Seasoned Poster
Seasoned Poster

Joined: 31 May 2007
Posts: 75
Reputation: 18.5Reputation: 18.5 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Fri Aug 15, 2008 13:21    Post subject: dead end search Reply with quote

tilqicom,

thanks for the vote of confidence. I searched but kept hitting dead ends and 'blog by email' stuff.

Hopefully, someone has an idea on this, or an old archived post.

cheers
Back to top
View user's profile Send private message
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Fri Aug 15, 2008 14:58    Post subject: Reply with quote

Do you really use 1.10.x version or it's a forum bug again?

I made a hack for 2.x
Save the code as conf/hacks.php

PHP:
<?php

$sender_name 
'Admin';
$sender_address 'admin@blog.com';
$subject 'Message subject';
$message 'Message body';


if( !empty( 
$_GET['send_messages'] ) )
{
    global 
$Messages;
    
    
$UserCache = & get_Cache'UserCache' );
    
    for( 
$recipient_User = & $UserCache->get_first(); !is_null($recipient_User); $recipient_User = & $UserCache->get_next() )
    {
        
$recipient_name quoted_printable_encodetrim($recipient_User->get('preferredname')) );
        
$recipient_address =  $recipient_name.' <'.$recipient_User->get('email').'>';
        
        if( 
$recipient_User->group_ID != )
        {
            if( 
send_mail$recipient_address$subject$message"$sender_name <$sender_address>" ) )
                
$Messages->addsprintfT_('Your message has been sent to "%s"'), $recipient_User->get('preferredname') ), 'success' );
        }
    }
}


// Quoted printable encode
function quoted_printable_encode$string$charset 'utf-8' )
{
  
$string rawurlencode($string);
  
$string str_replace("%","=",$string);
  return 
"=?".$charset."?Q?".$string."?=";
}

?>


Type the following in address bar to run the script
Code:
YOUR_BLOG/index.php?send_messages=1


If you want to try the script first use
if( $recipient_User->ID == 1 )

_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Fri Aug 15, 2008 15:00    Post subject: Reply with quote

I'll probably make a plugin from this hack with HTML and attachments support.
_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
adriscoll
Seasoned Poster
Seasoned Poster

Joined: 31 May 2007
Posts: 75
Reputation: 18.5Reputation: 18.5 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Fri Aug 15, 2008 17:18    Post subject: emailing by designation Reply with quote

sam2kb,

is the userid = 1 what distinguishes admin, bloggers, standard login, etc?

i am currently upgrading to the latest version (2.4.2 i believe), and can run your hack once I am done.

I would really like to push an email to varying levels and customize the email accordingly.

thanks again.
Back to top
View user's profile Send private message
tilqicom
Guru
Guru

Joined: 14 Nov 2007
Posts: 1624
Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8Reputation: 6.8 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 20

PostPosted: Fri Aug 15, 2008 17:24    Post subject: version bug Reply with quote

sam2kb wrote:
Do you really use 1.10.x version or it's a forum bug again?

I was also gonna mention that but i presumed the bug took action already..When talking of that tiny bug; is it really that hard to fix that bug ? or at least disable that dropdown box; so that the user will have to type his version instead of choosing a misleading one ?

_________________


.: linkback ≠ spam, yes to linkback, no to spam Shy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Fri Aug 15, 2008 19:14    Post subject: Reply with quote

This script was tested for 2 minutes or so that's why I think you should send a test message to admin first
PHP:
if( $recipient_User->ID == 


Then you can use any combination

Send to all users except Administrators
PHP:
if( $recipient_User->group_ID != 

Send to users #4 and #9
PHP:
if( $recipient_User->ID == || $recipient_User->ID == 

_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Fri Aug 22, 2008 22:03    Post subject: Reply with quote

Mail Sender plugin http://forums.b2evolution.net/...hp?t=16454
_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> b2evolution Support All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board