I know customer's password has been removed from Magento 2 for security reasons but it is requirement.
Default Magento 2
not provide a password with new account email. but we have required password in the welcome email.
Default Magento 2 Mail Template:
<!--@vars {
"var this.getUrl($store, 'customer/account/')":"Customer Account URL",
"var customer.email":"Customer Email",
"var customer.name":"Customer Name"
} @-->
{{template config_path="design/email/header_template"}}
<p class="greeting">{{trans "%name," name=$customer.name}}</p>
<p>{{trans "Welcome to %store_name." store_name=$store.getFrontendName()}}</p>
<p>
{{trans
'To sign in to our site, use these credentials during checkout or on the <a href="%customer_url">My Account</a> page:'
customer_url=$this.getUrl($store,'customer/account/',[_nosid:1])
|raw}}
</p>
<table class="email-credentials">
<tr>
<th>{{trans "Email:"}}</th>
<td>{{var customer.email}}</td>
</tr>
<tr>
<th>{{trans "Password:"}}</th>
<td><em>{{trans "Password you set when creating account"}}</em></td>
</tr>
</table>
I want: {{var customer.password}}
But the issue is that password is not setting in the mail.
Can you please let me know how I can set customer password in the mail template or any other solution.
Best Answer
Email template variable {{var customer.password}} has been removed from Magento 2 for some security reasons. If you want to send the password to a customer on new account creation, then you have to use your custom email template. Follow below steps.