modification email notification

Submitted by suminda on

hi,
1.how the system allow to generate email only for the attr value for user attr type, only in case of immediate notification, in job.php i found it generate for all users where both email and alerts configured.
2. in cron job logs, how to put all emails sent instead of count in sent++. this is to troubleshoot some email issue.

regards,
suminda

1. You can associate the alert with a view with any filter conditions, so the notification can be sent only when certain attribute matches a specific value.

2. You can simply write the body and other data to a text file just after the call to $engine->send().

Regards,
Michał

hi Michał,

thanks for prompt reply,

1. well understood, actualy I forgot that logic,
2. small clarification, I need only email Ids to be displayed, as "cron job finished (emails sent to x,y,z Ids)", instead of "cron job finished ( sent 3 emails)".

regards,
suminda,

OK, I'm assuming that you mean user IDs?

Add the following member declaration:

private $sentIds = array();

Add the following below $this->sent++;

$this->sentIds[] = $principal->getUserId();

Finally, change the log message to something like:

$eventLog->tr( 'Cron job finished (emails sent to %1)', null, implode( ', ', $this->sentIds ) )

Regards,
Michał

hi michal, many thanks for ur excellent coding and its working well.

can I use te the following istead of $pricipal->getuserId,

$principal-> getuserNames, I tried but getting error

regards
suminda

hi michal,
I tried but getting following error in events and cron also showing error.

php error:output generated before sending the response in c:\intpub\ncat\cron\job.php on line 1.

what could be the reason for this?

secondly, how admin can view currently logged users, hope you have not implemented yet, until that can I read users with active sessions at each cron running, and push to assess events?

regards,

suminda,

hi Michal,

any idea on my last update above?

regards,
suminda.

Hi Michal,

I successfully upgraded from 1.04 to beta-2. How to do the above email notification change with job.php in beta-2, can you pls help?

regards,
suminda,