Log in


  • Category: User admin
  • License: GNU General Public License (GPL) version 2
  • Updated: 2012-12-4
  • Downloads: 2064
  • Recommendations: 17


Previous releases:

Other Projects

View Mark's plugins

Welcome Message for Elgg 1.8

Sends a welcome message to a user the first time they log in

by Mark
Last updated 610 days ago

Sets the site notifications of new users to true when they first log in and sends them a welcome message from the administrator account.

Users before activation of this plugin wont be affected.

Note: After activation, admin should straight away fill out the Welcome Message subject and content. Message wont be sent until this is done

P.S. We've spent many hours creating free plugins for Elgg. Please take a minute to give something back by liking us on facebook http://www.facebook.com/webintelligence.ie


  • Eloy E Valderrama M 610 days ago

    Excelente trabaja muy bien en  Elgg 1.8.8

  • Mark 610 days ago


  • Starphysique 609 days ago

    Very nice idea, thank you. For future releases (if you plan any) it would be nice to select from which user the email is coming from, instead of just the administrator (I take it the first admistrator of site in case of multiple administrators.) Again, thanks for the plugin.

  • SDBradio 585 days ago

    looks good, easy setup, great idea...much appreciated!

  • Mark 585 days ago

    Thanks @SDBradi:)

    @Starphysique  Yes its the first administrator on the site, the one created during installation. Yes for future releases, I will allow users to choose which account the welcome message comes from

  • Alex Rivera 584 days ago

    ---> Lo vamos a probar...!!

  • Matt Beckett 562 days ago

    Hi Mark,

    Was just looking over the code for this:

    $personal[$method] = 1;

    set_user_notification_setting($object->getGUID(), $method, ($personal[$method] == '1') ? true : false);

    Is it enabling all notification methods for the user here?  You explicitly declare $personal[$method] = 1; then check for it in the next line.  So as far as I can see it will always be true and always turn on all notification methods...

  • Mark 562 days ago

    Just checked matt and yes, it's a useless bit of code! I will change it simply to passing through "true". Yeah it sets all notification methods for users to true, because internal messages are off by default.

  • Matt Beckett 557 days ago

    ok, thanks for confirming that.  The problem I foresee then, is that I want to use this plugin on an existing installation.  However as soon as I do this it will mess with the notification settings that all my users have set for themselves.  How about using the methods_override parameter of notify_user?  I think that would make this plugin safe to add to an existing site.

  • Mark 557 days ago

    Only users who have registered after this plugin has been activated will be affected. So the first time they log in, they wont have touched their notification (it will be at the default of email on, message off)...At least thats the way it should work;)

  • DhrupDeScoop 557 days ago


    me not see any value in all that fooling around with relationships and fancy 10 lines of php code footsies and merengue ;) if you want to check if a user is logging for the first time - the simple piece of code needed is ==> if ($user->last_login==0   why in this galaxy would you code any more ?



  • Mark 557 days ago

    @Dhrup I use relationships everywhere i can instead of metadata simply because the code executes quicker

  • DhrupDeScoop 557 days ago

    thats still no excuse for not just using data that is already available in the table ;oO no reason for replaciing ONE  simple phrase with 10 - 20 or more lines of code, is it ? now can relationships code 10-20 lines of php execute faster than one variable reference $user->last_login==0 ? it does not execute faster LOLZ ;-) not everything in the world fits into our specially shaped relationship baskets ! read the mysql structures ;-X
    CREATE TABLE IF NOT EXISTS `users_entity`
      `guid` bigint(20) unsigned NOT NULL,
      `name` text NOT NULL,
      `username` varchar(128) NOT NULL DEFAULT '',
      `last_action` int(11) NOT NULL DEFAULT '0',
      `prev_last_action` int(11) NOT NULL DEFAULT '0',
      `last_login` int(11) NOT NULL DEFAULT '0',
      `prev_last_login` int(11) NOT NULL DEFAULT '0',

  • Mark 557 days ago

    Sorry I read that wrong and thought last_login was metadata, not already in the user_entity table. Yeah you are right, in this scenario its obviously quicker to use last_login (dont know how i didnt think of that when writing it!)

  • Matt Beckett 556 days ago

    Hi Mark,

    I went back through the code, you're right it shouldn't affect existing users.  I missed the fact that you set a default welcome message time in activate.php.

    Re: Dhrups suggestion - last_login is probably more reliable as well, just in case a relationship gets dropped somehow.  Also, with the agressive metadata caching/pre-fetching coming in 1.8.9 there shouldn't be an issue using metadata for simple things like this  :)

  • Roman 478 days ago

    Any tokens, like %username% or %password% can be used to show username and password for example?


    Thank you.


  • Mark 477 days ago

    Hi Roman, you would need to parse the body of the message on line 77 in start.php. So you could search $body and replace %username% with $object->username and %password% with $object->password. Let me know how it goes

  • Roman 476 days ago

    Well, I was almost happy to see it sending parsed message, %username% was correct but %password% is encrypted password string, not password string entered by user. It was easy one, had to add 2 lines of php to the start.php file:

    lines 78-79:

                                $body = str_replace("%username%",$object->username,$body);
                                $body = str_replace("%password%",$object->password,$body);                         

  • Mark 476 days ago

    Yes actually you wont be able to send typed password, its hashed before saving to database

  • Roman 476 days ago