Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Email from Admin, Error


Guest

Recommended Posts

Posted

When I change the password to my admin I get an email, but the subject says: ADMIN_EMAIL_SUBJECT and the body of the email only has: ADMIN_EMAIL_TEXT ?

Emails for new customers and orders are all fine, just this one is giving me trouble. Anyone know what might be causing it? As far as I know I haven't mucked around in any of these files.

Posted

This must be referring to a contribution (the standard install does nothing like this), but which one?

 

The description of "Admin Account with Access Level" refers to an email notification, perhaps this is it? It was written for MS1.

 

Reviewing the files of this contribution and its README, it appears that both admin_account.php and admin_members.php compose an email using the function sprintf and ADMIN_EMAIL_TEXT. The language file for admin_members.php does indeed have a define for ADMIN_EMAIL_TEXT, but the language file for admin_account.php does not.

 

So, I would copy the define from admin_members.php into admin_account.php since it is missing, then see what happens.

Posted

Yes, sorry it is ADMIN ACCESS with LEVEL.

 

I will have a go at your idea and see what happens :)

Posted

You are a genius! that fixed it I have a subject of New Admin Member

and text in the body giving me a link to the admin, my username but the password is missing and it should be there, because the message tells me to log in with it and then change it??

 

This is the code that calls it in to the email

define('ADMIN_EMAIL_TEXT', 'Hi %s,' . "\n\n" . 'You can access the admin panel with the following password. Once you access the admin, please change your password!' . "\n\n" . 'Website : %s' . "\n" . 'Username: %s' . "\n" . 'Password: %s' . "\n\n" . 'Thanks!' . "\n" . '%s' . "\n\n" . 'This is an automated response, please do not reply!');

 

any idea when it's not coming through?

 

Thanks!! :)

Posted

I don't have the time right now to do it for you, but what you need to do is match up the parameters of the sprintf call in admin_account.php to the "%s" tokens in the string ADMIN_EMAIL_TEXT.

 

The way the sprintf function works is to replace each of the "%s" tokens with the parameters of the function call (after the first one, which is the name of the string containing the tokens).

 

Make sure there are the same number of parameters as "%s" tokens, and that they match up correctly.

 

Once you get it working right, do the community a favor and post the corrected contribution.

Posted

well I didn't need to do anything more than copy those 2 defines into the admin_account.php

I added a new member to the admin I received an email giving me the username and password. I do not assign the password it is generated by the email. I thought it wasn't working because the emails took awhile to come through. But when I came on just now they were all there! woo hoo!! :)

If I (as top admin) change my password it shows in the email as -Hidden-

I think all is working fine now! Thanks for your help!!

 

I'm not sure I know how to post a corrected contrib??

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...