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.
Plugin events
razhar
New
Hey there,
I would like to develop a plugin that executes a script once a user has registered succsessfully. I looked up for the special event of the regiteration yet failed to fine it - can anyone direct me to the event's name?
0
Comments
This might be of help: http://vanillaforums.org/discussion/21910/execute-php-script-upon-user-registration
Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub
I've tried that, just to see if that's the one, but it doesn't really work... May you tell me what am I doing wrong?
email is a real email, by the way.
@razhar Could you please clarify what exactly doesn't work? Does the event handler get called?
My shop | About Me
@businessdad I actually don't know... I tried using the mail function to see if it's called by I didn't receive any email - so I assume it's not getting called
Objects are passed by reference in php so doing
&$Sender
is not good. Just use$Sender
Secondly. Make sure your mail setup is working. it already sends out emails. If you are not receiving them it is becuase you don't have one of the mailing options setup correctly like SMTP. Some host don't like SMTP so you have to go with an alternative.
As there is already a welcome email I can only assume that is the issue.
You could simply expand on the definition to include the information you'd like.
Lastly instead of using a mail generic function, why not tie in with the framework's own email system?
grep is your friend.
@0xx Thanks for the response. The plugin has nothing to do with the email, actually, I just wanted to use it so I'll know the handler got called. The mail function is actually working outside of this script (I'm using it in other sites of mine).
I assume this is a problem with the handler function itself, maybe I'm just using it wrong?
That event is not attached to UserModel but EntryController, if in doubt grep.
grep is your friend.
As simple as changing a word, huh? Thanks for the help!
For simple debugging, the good old
var_dump()
could be a better option, as it gives you immediate feedback. Besides, using PHPmail()
could give you misleading results, as, sometimes, mail is sent successfully, but silently rejected by the destination servers as considered spam. I found an article that can give you more details: How to Pass Spam Filters with PHP mail().My shop | About Me
@businessdad Thanks for that, nice article - will sure help in the future. By the way, do you guys have any idea how to use perform an INSERT MySQL query? I found the answer for a SELECT one only...
Thanks
Hey guys, just looked around alittle bit and found the soulotion for that in another plugin. Thanks!