Trouble extending an event
Permalink
Hey guys,
I want to send an email to a user upon activation of his profile. For this I extend the on_user_activate event:
This works and the event is extended and on_activation.php is 'called'. However I get the following error message:
"Parse error: syntax error, unexpected T_STRING, expecting ';' or '{' in /mail/on_activation.php on line 4" (which is the line with public function…)
The on_activation.php looks like this:
I'm a bit at a loss here. Obviously I'm overlooking something stupid. Can you help? Thanks!
I want to send an email to a user upon activation of his profile. For this I extend the on_user_activate event:
<?php Events::extend('on_user_activate', 'OnActivation', 'sendActivationMail', 'mail/on_activation.php'); ?>
This works and the event is extended and on_activation.php is 'called'. However I get the following error message:
"Parse error: syntax error, unexpected T_STRING, expecting ';' or '{' in /mail/on_activation.php on line 4" (which is the line with public function…)
The on_activation.php looks like this:
I'm a bit at a loss here. Obviously I'm overlooking something stupid. Can you help? Thanks!
Oh well, it seems like it had been some text encoding trouble. Converted it to UTF-16 and now it works. Veeeeery strange.
Thank you Andrew.
Thank you Andrew.
One more problem with this code, maybe you can provide a hint for that one, too. The mail helper doesn't seem to do much here. Regardless if I set the $mh->to to a hardcoded email address and also regardless if I try to use a template or not. No mail seems to be sent. Am I missing something?
Thanks!
Thanks!
Sorry to bump this, but does anyone have an idea what is preventing the mail helper from sending mail in this code? Thanks!
Sent from my iPhone