Jump to content

Admin Recieve Email When New User Registers?


Rabatkoder

Recommended Posts

Hello, how do i edit this code to send to a specific email adress when a new user registers?

I want to forward all the information except password. :-)

The snippet is from AuthController.php

 

protected function sendConfirmationMail(Customer $customer)
{
 return Mail::Send(
  $this->context->language->id,
  'account',
  Mail::l('Welcome!'),
  array(
   '{firstname}' => $customer->firstname,
   '{lastname}' => $customer->lastname,
   '{email}' => $customer->email,
   '{passwd}' => Tools::getValue('passwd')),
  $customer->email,
  $customer->firstname.' '.$customer->lastname
 );
}

Link to comment
Share on other sites

You could copy the command to send the Email and resend it to another Email address. Something like (Didn't test it, but think should work like this):

 

protected function sendConfirmationMail(Customer $customer)

{

// first send info to new receiver

Mail::Send( // No return yet...

$this->context->language->id,

'account',

Mail::l('Welcome!'),

array(

'{firstname}' => $customer->firstname,

'{lastname}' => $customer->lastname,

'{email}' => $customer->email,

'{passwd}' => '<hidden>'), // Edit here

'[email protected]', // Edit here

'Receiver first name'.' '.'Receiver last name'

);

 

// Then send original message

return Mail::Send(

$this->context->language->id,

'account',

Mail::l('Welcome!'),

array(

'{firstname}' => $customer->firstname,

'{lastname}' => $customer->lastname,

'{email}' => $customer->email,

'{passwd}' => Tools::getValue('passwd')),

$customer->email,

$customer->firstname.' '.$customer->lastname

);

 

}

 

Hope this helps,

Pascal

Edited by PascalVG (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...