I want to send a welcome email when people join, I have my registration set the to "basic" method. Basically, as soon as they join I want to send them an email that just says welcome to the site.
UserModel has an event in its _Insert() method, fired like so: $this->FireEvent('AfterInsertUser');
So you could write a plugin that hooks that method, like so: public function UserModel_AfterInsertUser_Handler($Sender) { ... }
Within that hook you could add some code to send an email to the newly inserted user whose ID would be available in the EventArguments, like so: $Sender->EventArguments['InsertUserID']
Thx for the fast reply and your input, I'll see what I can do. I'm not that PHP savy so some of this stuff is gibberish to me. I have trouble understanding all the objects and $this flying everywhere.
Comments
- Spam
- Abuse
- Troll
-3 • Off Topic Insightful Awesome LOL •$this->FireEvent('AfterInsertUser');So you could write a plugin that hooks that method, like so:
public function UserModel_AfterInsertUser_Handler($Sender) { ... }Within that hook you could add some code to send an email to the newly inserted user whose ID would be available in the EventArguments, like so:
$Sender->EventArguments['InsertUserID']Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •$UserID = GetValue('InsertUserID', $Sender->EventArguments, NULL);if (!is_null($UserID) {
$UserData = $Sender->Get($UserID);
$UserEmail = GetValue('Email', $UserData);
}
Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
-3 • Off Topic Insightful Awesome LOL •