Forums

Register mail

BNDragon 22 Sep, 2014
Hello everyone,

I have a problem with the registration email.

I made a very simple registration form, which worked fine, the only problem is that the registration email is Envido for the user to confirm your account. The email is sent, but when I click on the activation link, the account is not active, a warning appears when I login with the new user to say that the account is not yet active and is still blocked. Will can help me?

Thanks in advance,

BN
GreyHead 22 Sep, 2014
Hi BN,

Is this using a Joomla email or a custom ChronoForms one? What does the link in the email look like?

Bob
BNDragon 22 Sep, 2014
Hi Bob,

I forgot to say that I'm using integration with CB.

I believe it is the joomla because I did not do any email for activation (was the question I was going to do next, incidentally), it is possible to use a custom message? How can I do this and send the activation link?

This is how the link is like:

http://mydomain.com/component/users/?task=registration.activate&token=81729c1c7090d189ea90fdc5f27cd129

BN
BNDragon 23 Sep, 2014
Hello Bob,

Sorry to bother you again, but I really need your help on this problem.
I'm in line for the launch. Just some settings, including resolution of this issue.

Thanks in advance,
BN
GreyHead 23 Sep, 2014
Hi BN,

Sorry, I'm travelling this week and so only on line from time to time.

That looks like a Joomla validation URL - but it's a SEF URL so possibly isn't working correctly.

You should check that the validation key is set in the #__users table (it probably is) and see if the link works OK. If not then I'm not sure how you get round the SEF problem. The plain URL should, I think be
http://mydomain.com/index.php?option=com_users&task=registration.activate&token=81729c1c7090d189ea90fdc5f27cd129

Bob
BNDragon 23 Sep, 2014
Hi Bob,

Thanks for your reply.

This unfortunately did not work. :/

But questions you wonder if the message was from Joomla or was custom. Which brings me to the question: Can I create a custom message? If so, how?

Thanks again.
BN
BNDragon 25 Sep, 2014
Hello Bob again,

Sorry to bother you again, know you're busy, but I really need your help, I'd appreciate it so you could enlighten me on this subject.

Cya,
BN
GreyHead 27 Sep, 2014
Hi BN,

The simplest answer to this is probably to turn off the Joomla! validation email and use a ChronoForms email instead. I think that if you set the Joomla! Activation Email to No in the Joomla! Registration action you can add a ChronoForms Email action afterwards. Use a Debugger action to check if CF adds the validation key to the $form->data[''] array or not. If it doesn't I think that you can get it from the User object for the new user.

Using a ChronoForms email should give you full control over the included link.

Bob
BNDragon 06 Oct, 2014
Hi Bob,

Thanks for your reply, and sorry to my late.

I'm having some difficulty to test what did you say to me.

In CF4 I wore your action ([greyhead] email) which worked perfectly, but now I can not send emails dynamically.
Gives an error saying that I need to have at least one recipe. Which makes sense, given that the debuger emerges as receiver ", {email}".

I do not know what to do here. : /

Can you help me here too please?

Thanks in advance,
BN
BNDragon 06 Oct, 2014
Hello Bob,

I have good news and bad news.

I did cheat a little, and put a fixed email while not solve the problem of dynamic dispatch.

The good news is that the activation email works perfectly, the user is activated when he clicks on the link.

The bad news is that the CB, the user is not approved or confirmed. : /

I have to enter the backend and do this manually.

How do I approve and confirm when the user clicks on the link?
I got the idea that this is not possible, so I raise another question that might work: How do I approve and confirm when the user clicks "Register"?

Thanks in advance,
BN
BNDragon 06 Oct, 2014
Hi Bob,

Find the way to set the dynamic email,it is weird.

It was enough to put a "-." In the "send to" and "email" (name / id of the field where the user enters their email address) in the "send to dynamically".

Now I need help on the confirmation / approval of the user automatically.

Thanks in advance,
BN
BNDragon 13 Oct, 2014
Hi Bob,

Finally I came back, I had some problems to solve, but now got back to this issue.

I've realized the problem and the solution is "simple", just enter the data for user registration in the CB table, which entitles me to a 404 page, but the user is registered (in the Users tab) but is not inserted tab in the CB.

What I'm doing is: if the user is registered, I use the action "Custom Code" to insert the record in the table:

<?php /*Novo acesso à Base de Dados*/


// Get a db connection.
$db = JFactory::getDbo();
 
// Create a new query object.
$query = $db->getQuery(true);
 
// Insert columns.
$columns = array('id', 'user_id', 'firstname', 'hits', 'avatarapproved', 'approved', 'confirmed');
 
// Insert values.
$values = array($id,$id,$nome,$falso,$vdd,$vdd,$vdd);
 
// Prepare the insert query.
$query
    ->insert($db->quoteName('#__comprofiler'))
    ->columns($db->quoteName($columns))
    ->values(implode(',', $values));
 
// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$db->query();


?>


This actually is my final code, I applied an example I saw on the Joomla API. But also I've used other codes as:

<?php /*Novo acesso à Base de Dados*/

	$con=mysqli_connect("localhost","espacoal_bn","brunofilipe@1420!","espacoal_ea");
	// Check connection
	if (mysqli_connect_errno())
	{
		echo "Erro ao conetar à base de dados: " . mysqli_connect_error();
	}
	
	$id = $form->data['_PLUGINS_']['joomla_registration']['id'];
$nome = $form->data['_PLUGINS_']['joomla_registration']['name'];
$falso = 0;
$vdd = 1;

	
$query = "INSERT INTO 'jos_comprofiler'('id', 'user_id', 'firstname', 'hits', 'avatarapproved', 'approved', 'confirmed') VALUES ($id,$id,$nome,$falso,$vdd,$vdd,$vdd)";

   if (!$con->query($query)) {
        printf("Error: %s\n", $con->error);
    }
	mysqli_close($con);


?>



Do you can help me?

I have some urgency to solve this problem.

Thanks in advance,

Cya
BN
BNDragon 13 Oct, 2014
Answer
Well, I sent the post and saw the problem, my final code is functional, just needs the declaration of variables that will get the form values​​:
	$id = $form->data['_PLUGINS_']['joomla_registration']['id'];
$nome = $form->data['_PLUGINS_']['joomla_registration']['name'];
$falso = 0;
$vdd = 1;


With so much copy / paste forgot to copy that part. xp

Just a note, the variable "$nome" (name) is a string, so you need to make a small change:
$nome = "'".$form->data['_PLUGINS_']['joomla_registration']['name']."'";



Thus, it is already recognized as a string.

The registration email is already functional.🙂
Next and last step (I hope) is the Social Login.
I have not done research, but to have a small inkling, it is possible to log in with social networks from CF?

Thanks again,

Cya,
BN
GreyHead 13 Oct, 2014
Hi BN,

I have not done research, but to have a small inkling, it is possible to log in with social networks from CF?

Yes it is - but exactly how depends on the network API and will need custom PHP to get it to work. This is similar to Payment Gateway connections - sometimes they are very simple, sometimes very complex.

Bob

PS PHP has a syntax that makes building stings simpler. Inside double quotes you can use {} to mark PHP variables. So
$nome = "'".$form->data['_PLUGINS_']['joomla_registration']['name']."'";
can be written as
$nome = "'{$form->data['_PLUGINS_']['joomla_registration']['name']}'";
which can be much easier to read and less chance of missing a quote.
BNDragon 13 Oct, 2014
Hi Bob,

Thanks for that tip, I did not know who gave write that way.

Relative to Login through social networks, there is no toturial? I'm searching the forum now for some topic to help me, but so far nothing yet. : /

(PS I can continue to ask here, or is it better to open another topic? Because I still am not clear my doubts, because there is still doubt, just lack of knowledge on the subject).

Again my thanks Bob,

Cya,
BN
This topic is locked and no more replies can be posted.