Email flow with automatic response
Posted: Tue Nov 18, 2014 6:39 pm
hello,
I have the following scenario:
The customer sends an e-mail. The subject line is checked for two words. In this example, Abc and Def. Are these the subject of the customer, he receives a confirmation by mail. The responses are composed also of variables.
It happens that the subject of the customer varies in the spelling, e.g. small or big letters. The idea now was to convert everything to little letters.
After a long effort you can solve this with variables directly on the connection
[Email.Subject: Case = lower] contains VALUE
Previously I wanted to solve this case with regex. A /ABC/i would have been sufficient.
Unfortunately, I was unable to establish the relation to the subject at any point in any way.
So I took my JavaScript:
function jobArrived( s : Switch, job : Job )
{
var betreff = job.getVariableAsString("[Email.Subject]");
var klein = betreff.toLowerCase();
job.setPrivateData("[Email.Subject]", klein);
job.sendToSingle( job.getPath() );
}
Now my questions:
regex:
How can I make reference to the variable [Email.Subject]?
Where do I configure the regex?
Java Script:
How can I make reference to the variable [Email.Subject]?
How can I bring the changed subject again to the flow so that it can be used?
Thanks for your reply...
Regards
rungew
I have the following scenario:
The customer sends an e-mail. The subject line is checked for two words. In this example, Abc and Def. Are these the subject of the customer, he receives a confirmation by mail. The responses are composed also of variables.
It happens that the subject of the customer varies in the spelling, e.g. small or big letters. The idea now was to convert everything to little letters.
After a long effort you can solve this with variables directly on the connection
[Email.Subject: Case = lower] contains VALUE
Previously I wanted to solve this case with regex. A /ABC/i would have been sufficient.
Unfortunately, I was unable to establish the relation to the subject at any point in any way.
So I took my JavaScript:
function jobArrived( s : Switch, job : Job )
{
var betreff = job.getVariableAsString("[Email.Subject]");
var klein = betreff.toLowerCase();
job.setPrivateData("[Email.Subject]", klein);
job.sendToSingle( job.getPath() );
}
Now my questions:
regex:
How can I make reference to the variable [Email.Subject]?
Where do I configure the regex?
Java Script:
How can I make reference to the variable [Email.Subject]?
How can I bring the changed subject again to the flow so that it can be used?
Thanks for your reply...
Regards
rungew