Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql-a2c-1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /var/www/html/wp-includes/wp-db.php on line 2024

Warning: mysqli_query(): (HY000/1021): Disk full (/tmp/#sql-a2c-1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device") in /var/www/html/wp-includes/wp-db.php on line 2024
class="post-353636 post type-post status-publish format-standard hentry" id="post-353636">

External User Registration Script – Change Email Content

Joomla 3.9.14

I have a script that will successfully register a user on my Joomla site via an external script.

The code is below;

<?php 
include('conn.php');

require_once JPATH_BASE .'/components/com_users/models/registration.php';

$model = new UsersModelRegistration();

jimport('joomla.mail.helper');
jimport('joomla.user.helper');

$language = JFactory::getLanguage();
$language->load('com_users', JPATH_SITE);

$username = 'adam';
$name = 'adam24';
$email = 'testmail@localhost.com';
$password = 'password';

$data = array( 
    'username' => $username,
    'name' => $name,
    'email1' => $email,
    'password1' => $password, // First password field
    'password2' => $password, // Confirm password field
    'groups'    =>array('10'),
    'block' => 0 );

echo $model->register($data);
?>

This creates a new user, adds the to the specified group, and sends them an email.

I am using this script on a subdomain of my joomla site – apps.example.com

I have the registration email set to self, so after registration the user will receive an email with a link to activate their account.

The issue is that the email body contains a link to my sub domain and not the root site. So the link is broken. The email body is as follows;

Hello adam24,

Thank you for registering at Apps Localhost. Your account is created
and must be activated before you can use it. To activate the account
select the following link or copy-paste it in your browser:
http://apps.example.local/component/users/?task=registration.activate&token=f33c96883366318886b241d2ca93d408&Itemid=101

After activation you may login to http://apps.example.local/
using the following username and password:

Username: adam

Password: password

Clicking this link results in a Internal Server Error. Which is correct because that location doesn’t exist on my subdomain.

I want to redirect the users to http://apps.example.local/login and display a message like;

Your account is now active and you can login.

What do I need to change in order to get this working?

Leave a Reply

Your email address will not be published. Required fields are marked *