Unusual Email Behavior when using cron

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
MisterBushido
Posts: 5
Joined: 22 Mar 2016, 01:44

Unusual Email Behavior when using cron

Post by MisterBushido »

I wrote three scripts for SENDING EMAILS in Mantis.

Each has this function to send email.

Code: Select all

function notify_email( $p_user_realname, $p_user_email, $v_bug_id , $v_QMR) {
	$v_subject = "Some text";
	$v_message = "Some text";
	
	if( !is_blank( $p_user_email ) ) {
		email_store( $p_user_email, $v_subject, $v_message );
		if( OFF == config_get( 'email_send_using_cronjob' ) ) {
			email_send_all();
		}

	}
}
When I run it manually it works and sends email ONCE.

When I run it using cron it works fine it sends the email but it sends twice or thrice or once and it varies (Meaning script1 sends email about bug1 twice but sends bug2 thrice and script2 sends email about bug1 thrice but sends bug2 twice something on day1 and on day2 the email that was sent thrice on the previous day was only sent twice today like that). the config on sending email using cron is OFF if it helps.

Any idea on what things I missed?

Thanks!
MisterBushido
Posts: 5
Joined: 22 Mar 2016, 01:44

Re: Unusual Email Behavior when using cron

Post by MisterBushido »

To be clear I just use the Cron on running the script not sending the email. Technically the process of sending the email is inside the script so it shouldn't be a bother right?
Post Reply