Welcome Message v1.8

  • 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.

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

  • 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

  • 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...

  • 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.

  • 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.

  • 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;)

  • @Mark:

    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 ?



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

  • 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',

  • 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!)

  • 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  :)

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


    Thank you.


  • 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

  • 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);                         

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

  • Elgg 1.9 Compatibility: Works fine (the only glitch is, I could could not include an image in the message). It gives the following harmless warnings on the plugin settings page: Deprecated in 1.8: The settings/welcomemessage/edit view has been deprecated. Use the view plugins/welcomemessage/settings

    Tested on 1.9.3 with around 10 non-bundled plugins installed.

    Would be great if it let you enter welcome messages per language.


  • great plugin !

    I don't know how I can add a image to the welcome message.

    I have tried in a lot of ways but image doesnt'appear in the mail.

    How can i do ?

    Thanks !

  • i have an updated version of this plugin for 1.9.x - 1.11.x.

    let me know if you would like to upload it to your plugin here.. otherwise i will create a new version.

  • @ura soul Hi, would you consider uploading your updated version?  regards.



Web Developer from Ireland


  • Category: User admin
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2764
  • Recommendations: 18

Other Projects

View Mark's plugins