Thursday 24 November 2005 3:20:04 pm
When in doupt, get dirty and hack the kernel: I got it working, the problem is that the /kernel/user/register.php doesn't allow for a sender in the registrationfeedback, so I just hacked it to include a sender and it worked. Look in /kernel/user/register.php and replace the block of code below:
$feedbackTypes = $ini->variableArray( 'UserSettings', 'RegistrationFeedback' );
foreach ( $feedbackTypes as $feedbackType )
{
switch ( $feedbackType )
{
case 'email':
{
$mail = new eZMail();
$tpl->resetVariables();
$tpl->setVariable( 'user', $user );
$tpl->setVariable( 'object', $object );
$tpl->setVariable( 'hostname', $hostname );
$templateResult =& $tpl->fetch( 'design:user/registrationfeedback.tpl' );
$feedbackReceiver = $ini->variable( 'UserSettings', 'RegistrationEmail' );
if ( !$feedbackReceiver )
$feedbackReceiver = $ini->variable( "MailSettings", "AdminEmail" );
$subject = ezi18n( 'kernel/user/register', 'New user registered' );
if ( $tpl->hasVariable( 'subject' ) )
$subject =& $tpl->variable( 'subject' );
if ( $tpl->hasVariable( 'email_receiver' ) )
$feedbackReceiver =& $tpl->variable( 'email_receiver' );
$mail->setReceiver( $feedbackReceiver );
$mail->setSubject( $subject );
$mail->setBody( $templateResult );
$mailResult = eZMailTransport::send( $mail );
} break;
default:
{
eZDebug::writeWarning( "Unknown feedback type '$feedbackType'", 'user/register' );
}
}
}
with this block:
$feedbackTypes = $ini->variableArray( 'UserSettings', 'RegistrationFeedback' );
foreach ( $feedbackTypes as $feedbackType )
{
switch ( $feedbackType )
{
case 'email':
{
$mail = new eZMail();
$tpl->resetVariables();
$tpl->setVariable( 'user', $user );
$tpl->setVariable( 'object', $object );
$tpl->setVariable( 'hostname', $hostname );
$templateResult =& $tpl->fetch( 'design:user/registrationfeedback.tpl' );
// hack to get email sender into rego feedback
$emailSender = $ini->variable( 'MailSettings', 'EmailSender' );
if ( !$emailSender )
$emailSender = $ini->variable( 'MailSettings', 'AdminEmail' );
$mail->setSender( $emailSender );
// end hack
$feedbackReceiver = $ini->variable( 'UserSettings', 'RegistrationEmail' );
if ( !$feedbackReceiver )
$feedbackReceiver = $ini->variable( "MailSettings", "AdminEmail" );
$subject = ezi18n( 'kernel/user/register', 'New user registered' );
if ( $tpl->hasVariable( 'subject' ) )
$subject =& $tpl->variable( 'subject' );
if ( $tpl->hasVariable( 'email_receiver' ) )
$feedbackReceiver =& $tpl->variable( 'email_receiver' );
$mail->setReceiver( $feedbackReceiver );
$mail->setSubject( $subject );
$mail->setBody( $templateResult );
$mailResult = eZMailTransport::send( $mail );
} break;
default:
{
eZDebug::writeWarning( "Unknown feedback type '$feedbackType'", 'user/register' );
}
}
}
And it should work, I hate hacking to core but this looks like the only way to get this working. Cheers!
Pardon me while I burst into flames...
|