Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Problem

  • I need to modify the standard Ee-mail textbody

Solution

  • change Change the stylesheet for the e-mail appointment

How to find and activate the style sheet, have you already looked up in the JobScheduler Wiki. You can find some parts in the style sheet, where the element <text> is displayed. You can place your individual text here. This applies then for the whole JobScheduler installation, but which is not to recommended in my view.

It would be better for your purposes, if you write your own mail job, which can be called in specific situations (e.g. occurring by specific errors). You can use for this the standard job JobSchedulerManagedMailJob, its description can be found in the database of your installation, which is located in the file jobs (in case you have installed the JobScheduler with the choice 'Job Package: Housekeeping Jobs').

Your job could look like this:

  • processing
  • The e-mail stylesheet is contained in the file ./config/scheduler_mail.xsl. See attached sample of scheduler_mail.xsl.
  • You can change any text contained in the stylesheet, e.g. for messages like this:
Code Block
languagexml
titleSample extract from stylesheet
...
    <xsl:template match="/scheduler_event [@event='database_wait']" mode="custom-message">
Code Block

    <job title = "Send Mails" order = "no" stop_on_error = "yes">
      <params>
        <param name="to" value="<mail_adress>" />
        <param name="from" value="<mail_adress>" /<!-- body text in case of database errors with need_db = yes -->
        <param<xsl:if nametest="subject$lang='de'" value="this is my mail" />
        <param name="host" value="<smtp_server>" />>Beim Zugriff auf die Datenbank ist ein Fehler aufgetreten. Der JobScheduler wartet bis die Datenbank wieder verfügbar ist.</xsl:if>
        <param<xsl:if nametest="queue_directory" value="c:\temp\smtp" />
        <param name="body" value="this is my body" />
  $lang='en'">Error occurred accessing the database. The JobScheduler will wait until the database is accessible.</xsl:if>
    </params>
    <script language="java" java_class="sos.scheduler.managed.JobSchedulerManagedMailJob">
    </script>
 </job>
xsl:template>
...

 

Please note that individual changes to the stylesheet

  • will apply for all e-mail being sent by a JobScheduler Master. 
  • must be re-configured for each new installation of JobScheduler. The configuration is maintained during updates of the JobScheduler installation.

See also

 Here you can indicated an individual text. There are separate parameters for attachments.