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

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

报告相同问题?

悬赏问题

  • ¥60 Python如何后台操作Vmwake虚拟机键鼠
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容