Some exemples how to use CGFEURegister

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
raiyul
Forum Members
Forum Members
Posts: 14
Joined: Sat Jul 08, 2017 1:10 pm

Some exemples how to use CGFEURegister

Post by raiyul »

I try to use FEU version 3. The biggest problem I have is to use correctly CGFEURegister. Only writing on my page {CGFEURegister group='potentiel'} give me an error: "Cannot send email... no addresses". And the new registered user is in the page Frontend User Registrations. I try to understand the new documentation, but english is for me a foreign language (my first language is french, the second one german. Perhaps having some very simple example could help me. We are a little club and our members can register in order to read some pages giving information reserved to our members.
raiyul
Forum Members
Forum Members
Posts: 14
Joined: Sat Jul 08, 2017 1:10 pm

Re: Some examples how to use CGFEURegister

Post by raiyul »

  1. For the first message, no addresses, I found a convenient solution for my case, I put in the config.php file a $config['cgfr_username_whitelist'] entry with authorized email addresses.
  • But the user is still finishing in the page Frontend User Registrations. Could emails/on_register.eml solve the problem? In this case, where is to put that eml-file? And an example please would help me.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Some exemples how to use CGFEURegister

Post by calguy1000 »

There isn't much information in your post as to how you have configured FEU and CGFEURegister so I will go with some assumptions.

Assuming a default installation where you are calling {CGFEURegister group='somegroup'} on your 'Frontend User Registration' page. And the user must verify his email address. Then, once the user registers an email must be sent to the user to verify his email. This email contains a link.

Once the link is clicked on the user is presented with a form to enter the code (the code is usually pre-filled in the form) and the user hits submit. The user will still be on the 'Frontend User Registration' page at this point.

Assuming that the code is valid and the user is properly registered then the after_verify template is called. (the default one is after_verify.tpl), and a final message is displayed. The template looks like this:

Code: Select all

{if !empty($final_message)}
    <h3>{$mod->Lang('msg_welcome')} <span>{$user->username}</span> <em>({$feu_uid})</em></h3>
    <div class="alert alert-info">
        {$final_message}
	{if $logged_in}
	    {* we are logged in, we could link to the members are, or redirect there *}
	{else}
	    {* we could use cms_selflink to link to a login page *}
	{/if}
    </div>
    {* we could also redirect here if we wished *}
{elseif !empty($error)}
    <div class="alert alert-danger">{$error}</div>
{else}
    <p>INTERNAL ERROR (this should not happen)</p>
{/if}
If in the design of your application you want the user to be redirected AFTER the verification is complete, OR you want to change the message, OR you want to use different styles you must override this template.

Do you see the section that begins with:

Code: Select all

{if !empty($final_message)}
Your overridden template needs to change this section.

So... the simplest way to do this is to:

Code: Select all

mkdir -p assets/module_custom/CGFEURegister/templates
cp modules/CGFEURegister/templates/after_verify.tpl  assets/module_custom/CGFEURegister/templates
nano assets/module_custom/CGFEURegister/templates/after_verify.tpl
(nano is a console based text editor in linux... use whatever editor you want).

and inside that 'if' statement use the {redirect_page} instead of displaying the final message.

i.e: something like:

Code: Select all

{if !empty($final_message)}
    {redirect_page page='member_home'} {* member_home is a sample page alias *}
{else}
   ....
{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
raiyul
Forum Members
Forum Members
Posts: 14
Joined: Sat Jul 08, 2017 1:10 pm

Re: Some exemples how to use CGFEURegister

Post by raiyul »

Many thanks, but a problem lies in the first step. You write :
Assuming a default installation where you are calling {CGFEURegister group='somegroup'} on your 'Frontend User Registration' page. And the user must verify his email address. Then, once the user registers an email must be sent to the user to verify his email. This email contains a link.
But by my installation, that was running well with FrontEndUsers 2.12.6 and CGExtensions 1.61.4, after going to to FrontEndUsers 3.1.4 and adequate CGExtensions (1.64.8 ) that part with CGFEURegister (instead of SelfRegistration) and appropriate addresses in the config.php file no email is sent. That's my problem now. Where should I verify if things are correct?
Waiting on an answer, I also will be searching for a solution.
raiyul
Forum Members
Forum Members
Posts: 14
Joined: Sat Jul 08, 2017 1:10 pm

Re: Some [solved]exemples how to use CGFEURegister

Post by raiyul »

I notice solved because I know where the error lies: sending an email to verify the email when user-name is not user-email is not running well. I wait until it is solved. There is a new post about this error and the whitelist for the case user-name is not email.
Post Reply

Return to “Modules/Add-Ons”