Page 1 of 1

CGCalendar EventAdded mailer

Posted: Mon May 16, 2011 4:30 pm
by the_obs
Hey all, this should be simple enough, I'm hoping someone with more skills than me can give it a second or two.
I'm trying to get an e-mail sent to a specific address every time an event is added to the CGCalendar module.
I created a UDT tag (temporarily with no advanced features, to see if I could get an e-mail sent on an event creation), with the following content:

global $gCms;

$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('specific@mail.com');
$cmsmailer->SetBody('New event');
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('New event');
$cmsmailer->Send();

But I don't receive anything. CMSMailer is set up fine (I used the test e-mail function, worked fine). How come I don't get any e-mail?

Once I get that sorted out, I'd like for the e-mail to have the following content:
Event name: {event_name}
Event date: {event start} to {event end}
Event created by: {creator}
But I'm not sure how to grab the content of these variables to insert them in the e-mail. Help!

Thanks!

CGCalendar 1.5.7
CMSMailer 2.0
CMS Made Simple 1.8.2

Re: CGCalendar EventAdded mailer

Posted: Tue May 17, 2011 11:10 am
by Jos
I added your udt to my own cmsms install and added it to the CGCalendar EventAdded event with the EventManager.

I get the same result. When adding a new Calendar-event I get no email.
In latest CMSms versions, you can run a UDT directly from the User Defined Tags Admin Panel. When I do this to your UDT, I do receive the wanted email.

My conclusion is there might be a bug in CGCalendar, the EventAdded does not get triggered.

CMSms version 1.9.4.1
CGCalendar version 1.6.1