Forums / Setup & design / Problem with Registration Email

Problem with Registration Email

Author Message

Marko Žmak

Tuesday 22 November 2005 5:42:53 am

I have setup user registration on my eZ site, everything works OK except that in emails notices about user registrations that come to the admin email, the sender is "www-data". Where do I set this sende? This is how my eZ config looks like:

[UserSettings]
RegistrationEmail=myemail@myemail.com
UserClassID=53
LogoutRedirect=/content/view/full/2

[MailSettings]
AdminEmail=myemail@myemail.com
EmailSender=myemail@myemail.com

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Wednesday 23 November 2005 2:11:59 pm

Does anyone know an answer to this?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nathan Kelly

Wednesday 23 November 2005 3:23:16 pm

Hi Marko, do you have your siteURL set in your site ini?

[SiteSettings]
SiteName=mysite
SiteURL=???

I'm not sure if that makes a difference?

I have a similar issue, my registration emails all come through with the sender as the site name, whereas my contact forms come through with the sender as the EmailSender set in the site ini.

[MailSettings]
Transport=sendmail
AdminEmail=admin@site.com.au
EmailSender=company@site.com.au

Also my admin receives an email from: "Nobody www.site.com.au", How do I change "Nobody" to what I want, where does the word Nobody come from?

Cheers!

Pardon me while I burst into flames...

Marko Žmak

Thursday 24 November 2005 2:11:49 pm

This last problem that you described (the mail that admin gets) is my problem too. "Nobody" in your case (and "www-data" in my case) comes from the mail sender program that PHP uses, it depens on the configuration of your server.

This happens when an email is sent without "Sender" specified, the mail program automatically puts something like this. This probably means that eZ dosen't set the Sender when sending this emails to the admin, but I would like to know if eZ can be configured in a way that it sets the Sender.

Can anyone give an answer to this?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nathan Kelly

Thursday 24 November 2005 3:02:23 pm

Well I spent most of yesterday and this morning trying to figure this out but nothing I do seems to work.

Surely someone has some idea how this "email sender" can be set?

Pardon me while I burst into flames...

Nathan Kelly

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...

Marko Žmak

Friday 25 November 2005 4:05:38 pm

Yes I hate hacking too. Right now this issue isn't so crucial for me, so I'll rather wait until something like this is in eZ release.

Maybe this could be proposed to eZ team as a improvement/suggestion.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

eZ debug

Timing: Jan 18 2025 16:28:19
Script start
Timing: Jan 18 2025 16:28:19
Module start 'content'
Timing: Jan 18 2025 16:28:20
Module end 'content'
Timing: Jan 18 2025 16:28:20
Script end

Main resources:

Total runtime0.9903 sec
Peak memory usage4,096.0000 KB
Database Queries206

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 587.7266180.8359
Module start 'content' 0.00660.8025 768.5625623.7344
Module end 'content' 0.80910.1811 1,392.2969345.0938
Script end 0.9902  1,737.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.3792210.0002
Check MTime0.00140.1442210.0001
Mysql Total
Database connection0.00100.097610.0010
Mysqli_queries0.895490.41312060.0043
Looping result0.00260.25882040.0000
Template Total0.965697.520.4828
Template load0.00210.212020.0010
Template processing0.963597.293220.4818
Template load and register function0.00010.012310.0001
states
state_id_array0.00090.086710.0009
state_identifier_array0.00070.066820.0003
Override
Cache load0.00190.1873470.0000
Sytem overhead
Fetch class attribute can translate value0.00170.167030.0006
Fetch class attribute name0.00110.113090.0001
XML
Image XML parsing0.00120.117230.0004
class_abstraction
Instantiating content class attribute0.00010.0052140.0000
General
dbfile0.00310.3092350.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs