SOLVED Send mail to user when added to admin area SERVER ERR

General project discussion. NOT for help questions.
Post Reply
qido
Forum Members
Forum Members
Posts: 13
Joined: Wed Apr 05, 2006 3:57 pm

SOLVED Send mail to user when added to admin area SERVER ERR

Post by qido »

Hi all

First of all I use CMSMS 1.10.3 and I use this UDT with event handler "UserAddPost"
http://wiki.cmsmadesimple.org/index.php ... in_Console

But it gives a server error when adding a new user to the admin panel.

I have so fare figured out that this marked out stop the server error

Code: Select all

if($newuser->email != "" && validate_email($newuser->email)){
  $cmsmailer = $this->GetModuleInstance('CMSMailer');
  $cmsmailer->AddAddress($newuser->email);
  $cmsmailer->SetBody($bodytext);
  $cmsmailer->IsHTML(false);
  $cmsmailer->SetSubject($sitename.' User Account Information');
  $cmsmailer->Send();
}
I tried with just for the UDT

Code: Select all

  
  $cmsmailer = $this->GetModuleInstance('CMSMailer');
  $cmsmailer->AddAddress('somemail@earth.com','tester');
  $cmsmailer->SetBody('<h4>This is a test message</h4>');
  $cmsmailer->IsHTML(true);
  $cmsmailer->SetSubject('Test message');
  $cmsmailer->Send();
And this gives the same error, so it seems like there is something wrong with either the "AddUserPost" event or the mailer.

But so far I had no luck fixing it.

Can any one help?
Last edited by qido on Sun Aug 05, 2012 7:42 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Send mail to user when added to admin area SERVER ERROR

Post by calguy1000 »

There is no $this object when working in a UDT.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
manuel
Power Poster
Power Poster
Posts: 354
Joined: Fri Nov 30, 2007 9:15 am

Re: Send mail to user when added to admin area SERVER ERROR

Post by manuel »

I don't know if you will be able to send the password to users i but wanted to mention the notifications module just in case...
http://dev.cmsmadesimple.org/projects/notifications

Greetings,
Manuel
Do you like your open source cms? Buy from the CMSMS partners || Donate
qido
Forum Members
Forum Members
Posts: 13
Joined: Wed Apr 05, 2006 3:57 pm

Re: SOLVED Send mail to user when added to admin area SERVER

Post by qido »

Thx. Moved me in correct direction.
Post Reply

Return to “General Discussion”