Plugin SqlTable is similar to plugin FromSQL, but it works with SQL-requests that return several lines. Whereas FromSQL takes only the first line of values obtained as a result of the SELECT request and replaces macros in a message with respective values (e.g., all macros %%1%% in letter will be replaced with the value from the first column of the first line of the request result), SqlTable processes all lines of the request result.
To ensure that, macro %sqltable% is added. Usage example:
Dear sir,
please, see our price list below.
%sqltable%
Position: %%1%%
Price: $%%2%%
%sqltable%
WBR,
Sales Team
The plugin will repeat the block between %sqltable% macros for each line of the result and print values from the line columns in it. E.g. as a result of the request
SELECT position, price FROM price_list
the plugin will modify a message as follows:
Dear sir,
please, see our price list below.
Position: Advanced Direct Remailer
Price: $40
Position: Advanced Maillist Verify
Price: $40
Position: Advanced Email Parser
Price: $149
Position: Advanced Email Extractor
Price: $40
Position: Advanced Email Extractor PRO
Price: $99
WBR,
Sales Team
Configuration file of the plugin is similar to that of FromSQL and is extended with the following parameters:
Rowname. This parameter allows changing macro %sqltable% to any other. For example, to process a message in several runs.
FormatLeft and FormatRight set formatting parameters for long lines of a result. To disable formatting, set these values to 0.
SqlTable plugin files are located in the plugins subfolder of the Advanced Direct Remailer folder.
About FromSQL plugin, About FromCSV plugin, Internal SMTP server and mailboxes