2

We are using custom registration process in magento to register user. First step customer will register himself on the site and send a application receive an email to the customer and he will not be able to login without admin approval.

Once the admin approves the customer a welcome mail will go to a customer with login credentials.

But the issue is that password is not set in the mail.

Can you please let me know how I can set customer password in the mail template or any other solution

Mail Template

<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
        <tr>
            <td align="center" valign="top" style="padding:20px 0 20px 0">
                <!-- [ header starts here] -->
                <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
                    <tr>
                        <td valign="top">
                            <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
                    </tr>
                <!-- [ middle starts here] -->
                    <tr>
                        <td valign="top">
                            <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
                            <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Welcome to {{var store.getFrontendName()}}. To log in when visiting our site just click <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">Login</a> or <a href="{{store url="customer/account/"}}" style="color:#1E7EC8;">My Account</a> at the top of every page, and then enter your e-mail address and password.</p>
                            <p style="border:1px solid #E0E0E0; font-size:12px; line-height:16px; margin:0; padding:13px 18px; background:#f9f9f9;">
                                Use the following values when prompted to log in:<br/>
                                <strong>E-mail</strong>: {{var customer.email}}<br/>
                                <strong>Password</strong>: {{htmlescape var=$customer.password}}<p>
                            <p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">When you log in to your account, you will be able to do the following:</p>
                            <ul style="font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;">
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Proceed through checkout faster when making a purchase</li>
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Check the status of orders</li>
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; View past orders</li>
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Make changes to your account information</li>
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Change your password</li>
                                <li style="list-style:none inside; padding:0 0 0 10px;">&ndash; Store alternative addresses (for shipping to multiple family members and friends!)</li>
                            </ul>
                            <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
                        </td>
                    </tr>
                    <tr>
                        <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
</body>
6

That's not possible out of the box.
The password can be sent only when the user creates the account because that's the only time when you have the password in clear text.
Once it is saved in the db and you lose the customer instance you cannot get back the password because it is hashed.
But anyway, it's not a good practice to send the password via e-mail in clear text.
The customer should already know his password, and if he forgets it he can click on "Forgot my password"

  • Yeah @Marius I was thinking the same but need some advice from magento expert. Thanks for your response. – Pramod Kumar Sharma Sep 2 '14 at 6:28
1

U can extend welcome functionality Email and ( Mage_Customer_AccountController ) with and send own random generate password to user and save in customer account.

i have manage before 2 days see hear but my condition in small change.

                $customer = Mage::getModel("customer/customer");
                $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
                $customer->loadByEmail($login['username'])


                            $customer->setPassword($customer->generatePassword(8));
                            $customer->save();
                            $customer->sendNewAccountEmail();
0

I think (but not checked) it's fixed by CE 1.9.3.0

In http://devdocs.magento.com/guides/m1x/ce19-ee114/ce1.9_release-notes.html#ce19-1930security-pwd , we can read :

The new customer e-mail now includes the customer's password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.