doudan4834 2014-06-11 11:41
浏览 73
已采纳

从CSV文件添加Joomla 2.5中的用户并通知他们注册电子邮件

My requirement is to add users in Joomla 2.5 from a CSV file. After the user is added, it should send registration email to the user.

For eg. if I add a user from Joomla Admin panel and save it, it sends an registration email automatically.

I tried adding users directly in the _users table and _user_usergroup_map table. It does adds the users in Joomla but the registration email is not being sent.

Please let me know how can I do so.

Thanks

  • 写回答

1条回答 默认 最新

  • 普通网友 2014-06-16 13:30
    关注

    I solved this myself as-

    1. You need to have an CSV file with the data in it. It should have the column names according to the Joomla __users schema. Click here to download the sample CSV file.

    Make sure that at-least below columns are filled in (Rest can be left empty or if you wish, fill them too)-

    • Name
    • Username
    • Email-ID
    • Password (Use MD5 encrypted)
    • User Type (Generally 2 for Registered Users)

    Passwords need to be MD5 encrypted. For eg.- If password is- password123, its MD5 value would be- 482c811da5d5b4bc6d497ffa98491e38

    You can encrypt passwords from here- http://md5encryption.com/

    1. Copy this CSV file in the MySQL database folder. Generally '/var/lib/mysql' in Linux.

    2. Log in MySQL prompt / PhpMyAdmin with the user who has privileges to write in the DB.

    3. Select the DB and execute the below query:

    mysql> LOAD DATA INFILE '/var/lib/mysql/Final_Template_For_Adding_New_Joomla_2_5_Users.csv' INTO TABLE __users FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY ' ' IGNORE 1 LINES;

    This would add the users in __users table.

    4- Now you need to update the User ID & Group ID in the __user_usergroup_map table.

    To do this, download this sample MAP CSV file. You would need to note the user IDs and User Type of the users which you added in the __users table. Now update the rows accordingly.

    5- Follow step 2 and 3 again for this MAP CSV file and now execute this below query:

    mysql> LOAD DATA INFILE '/var/lib/mysql/Final_Template_For_Adding_New_Joomla_2_5_Users_MAP.csv' INTO TABLE __user_usergroup_map FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY ' ' IGNORE 1 LINES;

    Now all the users are added into the database. You can check them through Admin Panel > User Manager.

    If you want to send registration mails to the new registered users, you can use AcyMailing. Starter (Free) edition will do the work.

    You would now need to import the newly added users. Here is the documentation- https://www.acyba.com/acymailing/doc.html#tut Or you may search for videos on Youtube.

    Create a new list, select and subscribe the new users to this list.

    Create a newsletter with the message you want to send. It also has some tags through which you can fetch the values of username, Name variables, Email Id etc.

    Apply this newsletter for the list which you created and send the mail.

    If everything is okay, it will now send the emails to all the users subscribed to this list :)

    It will send emails in the batch of 40 mails i.e. 40 mails/batch, then it would sleep for 2 mins. and will continue sending emails.

    Hope it helps!

    Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何实验stm32主通道和互补通道独立输出
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题