Dear community,
i am trying to run some PHP Code after a new customer successfully created an account in our onlineshop.
my question is where to insert this PHP?
i assume the best way is to write a module which calls the CustomerAccountAdd Hook ? (And how does the Code has to Look like)
And the PHP Code or rather the Module itself should get triggered whenever a new account gets successfully registered. Is this automatically happening or do i have to tell the CustomerAccountAdd Hook That it always runs the module after an account was successfully created?
*Edit In this module i need to access the Email of the recently created account and Save as PHP var
I would be very glad if someone could help me out.
My Code for my module looks like following:
Anything i put in the hook function at bottom is not working...
<?php if (!defined('_PS_VERSION_')) exit; class SendEmail extends Module { public function __construct() { $this->name = 'SendEmail'; $this->tab = 'front_office_features'; $this->version = '1.2'; $this->author = 'Philip Zadeh'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.4', 'max' => '1.7'); parent::__construct(); $this->displayName = $this->l('SendEmail'); $this->description = $this->l('Activate to enable activation Emails for new Customers.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('SendEmail_NAME')) $this->warning = $this->l('No name provided'); } public function install() { return parent::install() && $this->registerHook('actionCustomerAccountAdd'); } public function hookActionCustomerAccountAdd($params) { } } ?>
Best regards,
Philip Zadeh