Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Welcome Email?

edited October 2010 in Vanilla 2.0 - 2.8
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.

Comments

  • RaizeRaize vancouver ✭✭
    and I need a turkey sandwich... with extra mayo lol
  • TimTim Operations Vanilla Staff
    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']

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • 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.
  • I've got it working for the most part, is there an easy way to grab the InsertUserID's Email??
  • TimTim Operations Vanilla Staff
    Assuming you're inside the UserModel's event handler:
    $UserID = GetValue('InsertUserID', $Sender->EventArguments, NULL); if (!is_null($UserID) { $UserData = $Sender->Get($UserID); $UserEmail = GetValue('Email', $UserData); }

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • Ya that did it man, I really appreciate your help.
  • TimTim Operations Vanilla Staff
    Sure, you got it.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • RaizeRaize vancouver ✭✭
    @CrazyCarlx2 now about that sandwich...
Sign In or Register to comment.