I have a switchscripter with a trafic light. If the scripts fails (error) the xml goes to the next model, mail send and this is working.
In my switchscripter code I have this loggin and I get the errors fine in the log.
job.fail( "Process shipment marking failed with the status code %1", theHTTP.statusCode );
job.fail("invalid response: %1", theHTTP.lastError);
job.log( 1, "Server response: %1", theHTTP.getServerResponse().toString( "UTF-8" ) );
But I want to access this errors in my nextmodule, the mail send email body. How can I do that?
theHTTP is not accessible from the email body so I can't use something like
[job.theHTTP.lastError]
Access Switchscripter error in mail body (next module)
-
- Member
- Posts: 40
- Joined: Tue Jan 15, 2019 10:19 pm
Re: Access Switchscripter error in mail body (next module)
job.fail takes the job to Problem jobs. When working with a traffic-light output you have to use
Where 1 takes it to success, 2 to warning and 3 to error.
And as to putting the error messages in the mail body:
and in the "Mail send" element set "Include attached body text" to "Yes".
Code: Select all
job.sendToData( 1/2/3, job.getPath());
And as to putting the error messages in the mail body:
Code: Select all
job.appendEmailBody("Process shipment marking failed with the status code " + theHTTP.statusCode );
job.appendEmailBody("invalid response: " + theHTTP.lastError);