Page 1 of 1

Upozorňovací e-mail v modulu SelfRegistration

Posted: Fri Feb 20, 2009 4:46 pm
by rostislavk
Ahoj,

potřeboval bych poradit s tímhle:

uživatele se registrují pomocí modulu SelfRegistration. Registrační formulář obsahuje kromě uživatelského jména a hesla ještě detaily uživatele (jméno, adresa, telefon, atd.), které jsou definovány pomocí modulu FrontEndUsers.

Potřeboval bych poslat upozornění e-mailem, když se někdo zaregistruje. To jde, v adminu modulu SelfRegistration zaškrtnu tuto možnost a funguje to. V došlém e-mailu je hláška s upozorněním a uživatelské jméno. Problém je v tom, že chci v tom upozorňovacím e-mailu mít i výpis detailů toho konkrétního uživatele.

O tohle se stará soubor SelfRegistration.module.php a tenhle kod:

Code: Select all

   // and notify the administrator
    // if the admin wants notifications.
    // off we go.
    if( $this->GetPreference('notify_on_registration') )
      {
	
	$cmsmailer =& $this->GetModuleInstance('CMSMailer');
	if( !$cmsmailer )
	  {
	    return $this->Lang('error_nocmsmailermodule');
	  }
	
	$cmsmailer->AddAddress($this->GetPreference('send_emails_to'));
	$cmsmailer->SetSubject('A new user has registered on '.$gCms->config['root_url']);
	$msg = 'A new user ('.$username.') has completed registration to your site. you should check this user out and validate that the information provided is as complete and valid as possible.';
	$cmsmailer->SetBody($msg);  
	$cmsmailer->IsHTML(false); // we're not sending an html mail
	$cmsmailer->Send();
      }

    $this->Audit( 0, $this->Lang('friendlyname'), 
		  $this->Lang('info_userverified').": ".$username);
    return 0;
  }
Nešlo by to nějak?

Díky za pomoc

Re: Upozorňovací e-mail v modulu SelfRegistration

Posted: Sat Feb 21, 2009 12:25 am
by kuzmany
Ahoj,

notifikacia si mozes nastavit aj v module Frontend User v zalozke s nastaveniami.  Uplne na konci si mozes nadefinovat na rozne akcie notifikaciu, konkretne v tvojom pripade On New User Created. V sablone si mozes potom napisat aky chces text, takisto mozes pouzit vsetky dostupne smarty premenne.

Ja som tu notifikaciu prebehol len easy, ale nieco potodbne potrebujem aj ja, takze sa na to pozriem podrobnejsie snad