Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Conversion corrections

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

General Mail Settings in the ./config/factory.ini

...

In the section spooler you have entries for the email addresses of the sender and recipients (incl. cc and bcc). Use a comma to separate multiple email addresses.

Code Block

 log_mail_from	         = 
 log_mail_to	         = 
 log_mail_cc	         = 
 log_mail_bcc	         = 

Further you must set the SMTP server

Code Block

 smtp	                 = 

The following entries control when a email will be sent.

Code Block

 ;                         send mail with job log in case of error (yes|no, default: no)
 mail_on_error           = yes
 ;                         send mail with job log in case of errors and warnings (yes|no, default: no); only for api jobs
 mail_on_warning         = yes
 ;                         send mail with job log in case of success (yes|no, default: no)
 mail_on_success         = no
 ;                         send mail with job log in case of process steps (yes|no|1|2|n, default: no); only for standalone api jobs
 mail_on_process         = no

In a section smtp you can set an email account if necessary

Code Block

 mail.smtp.user          =
 mail.smtp.password      =
 mail.smtp.port          = 25

...

We assume that you have a Job Chain with multiple Order-Jobs in the following structure.
Whenever a Job in the Job Chain has an error then the Order goes to the End Node 'error'.
Otherwise the Order goes to the next Job and finally in the End Node 'success'.

If you have set mail_on_errorh1. error = yes in the ./config/factory.ini (recommended), then you get max. one error mail per Job Chain Order.

If you have set mail_on_success = yes in the ./config/factory.ini, then you get a success mail for each Job in the Job Chain per Order.

If you have set mail_on_successh1. success = no in the ./config/factory.ini (recommended), then you get no success mail for each Job Chain per Order.

If you want exactly one 'success' mail per Job Chain Order then configure all Jobs except the last Job with mail_on_success = no.

We recommend that you create a new Order-Job which is called e.g. /lastJobChainJob. This Order-Job is the only Order-Job which has the mail_on_successh1. success = yes setting.

All other Order-Jobs should have mail_on_success = no.

You insert this Order-Job /lastJobChainJob to all Job Chains as the last Job.

The Job /lastJobChainJob can use the internal API to modify the mail subject in the following form:

Code Block

 <?xml version="1.0" encoding="ISO-8859-1"?>
 
 
 <job order="yes" stop_on_error="no">
     <settings>
         <mail_on_success><![CDATA[yes]]></mail_on_success>
     </settings> 
 
     <script language="javascript">
         <![CDATA[
 function spooler_process()\ { 
  
 	spooler_log.mail.subject = "job chain '" + spooler_task.order.job_chain.name() + "' has successfully finished";
 	return true;
 \}
         ]]>
     </script>
 
     <run_time />
 </job>