Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Send email to new user/member upon registration


Go to End


3 Posts   2122 Views

Avatar
Optic Blaze

Community Member, 190 Posts

15 July 2010 at 12:08am

Hi I am using SS2.3.2 and rc4 and ecommerce 0.6 beta. I want the system to email any new user that signs up/ is registered their username and password to the email address that they specified.

As far as i can tell from the documentation i have to extend the Member class and the write a onBeforeWrite() function that tells silverstripe to send an email to the new member, but i am not sure where to begin.

Some help please

Avatar
Bambii7

Community Member, 254 Posts

15 July 2010 at 11:07am

Hi Optic Blaze,
The Ecommerce module decorates the member class in the ecommerce/_config.php
DataObject::add_extension('Member', 'EcommerceRole');

You'll find the file in ecommerce/code/model/EcommerceRole.php
Around line 107 you'll see the code for making a new memeber. Something along the lines of

$email = new Email($from, $to, $subject, $body);
$email->sendPlain();

Will send mail. But you'll need to sus out what you want to send.

Avatar
Optic Blaze

Community Member, 190 Posts

15 July 2010 at 11:14pm

Thanks your a star