Pages: 1
RSS
Passing Data through HEADER, Printing an email with extra header information
 
What I am trying to do is have Thebat automatically print some messages it receives. These messages have a reference number that I want to be printed on the top of the page. What is the best way to pass this information through the email to the program??

Thanks!
 
It's easy to print the message automtically, just create a matching filter and add the printing action. The printing action asks for a template and it's just a matter of what you'd like to print, those thing you add to the template.

It doesn't matter how you include the reference number, you can place it in the subject header (or whatever header you specifically create for the purpose) or somewhere in the text. When you place it in the text, it always has to be in the same, otherwise it'll be a bit difficult to extract it with a regular expression.
__________________________________
I'm just a user of The Bat! I don't work for Ritlabs.
 
I am not that good with regular expressions. What I am looking to do is:

Have a line somewhere that will look like:

Reference=0123

I want to get 0123, print it on the top of the message and remove the line from the printed text. Could you give me a small example?

THANK you in advance!

Lucas
 
Here is a snippet you could use:

%SETPATTREGEXP='Reference=(\d{4})'%-
%REGEXPBLINDMATCH='%text'%-
%-
%_ref=%SubPatt(1)%-

Then simply specify %_ref anywhere in the text of the template at which you would want the reference number to appear.
iviarck
Pages: 1