SilverCart Forum

We moderate this Forum and we're here to help. Have you already run a forum search to check if your problem has already been solved?

You can help us helping you by providing detailed error messages, screenshots and logfile entries.

SebastianRamon

Page: 1
Topic Registration confirmation emails 1730 Views

Registration confirmation emails

26 May 2013 at 11:51pm Last edited: 28 May 2013 9:22am

Hi guys,

Is there a way to enable registration confirmation email. At this stage, the customer is automatically logged in after finish the registration.

Cheers,

Re: Registration confirmation emails

29 May 2013 at 1:35pm Last edited: 29 May 2013 1:36pm

Hi vitbeo,

the current version does not allow to enable this behavior.

If you want to add this function you have to add this by decorating the SilvercartRegisterRegularCustomerForm.php.

Inside your decorator you can overwrite the default registration method by implementing the method "overwriteSubmitSuccess".

You can add a custom, translatable email template in backend ("Configuration" -> "Shop Emails"). Set its "Identifier" to "MyCustomRegistrationConfirmation" and use something like that:

class MyCustomRegisterRegularCustomerForm extends DataObjectDecorator {

public function overwriteSubmitSuccess($data, $form, $formData) {
// Execute some code to register the customer.
// @see SilvercartRegisterRegularCustomerForm::submitSuccess()

// execute some code to send a Registration confirmation email
// for example:
SilvercartShopEmail::send(
'MyCustomRegistrationConfirmation',
$formData['email'],
array(
'FirstName' => $formData['FirstName'],
'Surname' => $formData['Surname'],
'Email' => $formData['Email'],
// ... and other template variables
)
);
return true;
}

}

Cheers,
Sebastian