I have a login and registration script to authenticate from android and iOS. The registration code works, I can register form app and I can see the user into the joomla db. The problem is that into the Joomla portal I use the activation mail and when I create a user from the script I receive a wrong mail. The mail have this object: COM_USERS_EMAIL_ACCOUNT_DETAILS and this text: COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY.
This is the registration script:
<?php
if( $_POST["name"] || $_POST["email"] || $_POST["username"] || $_POST["password"] ){
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$app = JFactory::getApplication('site');
$app->initialise();
require_once(JPATH_BASE.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php');
$model = new UsersModelRegistration();
jimport('joomla.mail.helper');
jimport('joomla.user.helper');
$username = $_POST['username'];
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$block = '0';
$sendEmail = '1';
$activation = '';
$data = array( 'username' => $username,
'name' => $name,
'email1' => $email,
'password1' => $password, // First password field
'password2' => $password, // Confirm password field
'sendEmail' => $sendEmail,
'activation' => $activation,
'block' => 0 );
echo $model->register($data);
}
?>
If I force the 'activation' camp Joomla overwrite with the activation code. The same with the block and sendEmail.
How can I disable the mail (only from app) or send the correct mail?
Thanks!