Skip to Content.
Sympa Menu

en - Re: [sympa-users] "editor_include" pass variable to mySQL query ?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Etienne MELEARD <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-users] "editor_include" pass variable to mySQL query ?
  • Date: Mon, 24 Feb 2014 09:42:18 +0100

Hi,

When setting

source_parameters foo bar somethingelse ...

you'll have

[%param.0%] = foo
[%param.1%] = bar
[%param.2%] = somethingelse
...


Regards,

Etienne MELEARD

--


Etienne MELEARD

GIP RENATER - Direction Technique
Etudes et Projets Applicatifs
Tél : +33 2 23 23 53 68 RENATER
Fax : +33 2 23 23 71 21 263 Av. du Gal. Leclerc
35042 Rennes Cedex

http://www.renater.fr

Le 21/02/2014 20:33, John Gibson a écrit :

Hi, all.

I would like to pass the list name as a variable into the SQL query from the "editor_include" paragraph.

The configuration shown below is working, but with a hard-coded query that returns "editor" which is an email address.

In the docs it has this:

sql_query SELECT DISTINCT email FROM dummy_emails WHERE email LIKE 'pipo+[%param.0%]%'

I am not sure what the syntax is or where the parameters come from.

Any help would be appreciated.

…john

*** DETAIL, the list name is "test1". This config is working, but uses hard-coded SQL entries.***

---snip from "test1" config file ---

editor_include

source my_editors

reception mail

visibility noconceal

source_parameters 9

--- from "my_editors.incl" file ---

include_sql_query

passwd 12345

db_name sympa_content

db_type mysql

user sympa_content

name mysql-data

sql_query SELECT editor FROM list_editor WHERE list_name = 'test1';

db_port 3306

host myhost.mydomain.edu






Archive powered by MHonArc 2.6.19+.

Top of Page