sympa-community / sympa

Sympa, Mailing List Management Software
https://www.sympa.community/sympa
GNU General Public License v2.0
237 stars 94 forks source link

Is it possible to set custom vars on xml creation list templates? #1793

Open gonzalo opened 5 months ago

gonzalo commented 5 months ago

Version

Sympa 6.2.70

Installation method

deb package

Expected behavior

I'm trying to add custom_vars into xml template files to standarize automatic creation of certain lists, but I don't know if is even possible.

What I'm trying to achieve is something like this.

<?xml version="1.0" ?> 
  <list> 
    <listname>forpruebav2</listname> 
    <type>my_type</type>
        <subject>XML generated list xxxxx</subject> 
        <status>open</status> 
        <topics>my_topic</topics> 
    <language>es</language> 
    <owner multiple="1"> 
       <email>my@mail.com</email> 
    </owner> 
        <custom_subject>TEST LIST</custom_subject>
        <custom_vars>
           <var name=“my_custom_var_name" value="/xxx/xxx/xxxx/my_file.txt"/>
        </custom_vars>
  </list>

The template work (list is created), but obviously custom_vars section is just "ignored"

ikedas commented 5 months ago

XML element should be:

        <custom_vars multiple="1">
           <name>my_custom_var_name</name>
           <value>/xxx/xxx/xxxx/my_file.txt</value>
        </custom_vars>

And you may add the parameter to config.tt2 of list creation template:

(Existing content of config.tt2...)

[% FOREACH v = custom_vars %]
custom_vars
  [% v.name %] [%v.value %]

[% END %]
gonzalo commented 5 months ago

Thank you I will test and let you know

regards

-- Gonzalo

El dom, 28 ene 2024 a las 2:33, IKEDA Soji @.***>) escribió:

XML element should be:

    <custom_vars multiple="1">
       <name>my_custom_var_name</name>
       <value>/xxx/xxx/xxxx/my_file.txt</value>
    </custom_vars>

And you may add the parameter to config.tt2 of list creation template:

(Existing content of config.tt2...)

[% FOREACH v = custom_vars %] custom_vars [% v.name %] [%v.value %]

[% END %]

— Reply to this email directly, view it on GitHub https://github.com/sympa-community/sympa/issues/1793#issuecomment-1913401935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOAMMZSSSV7AWZTMOPQRTYQWTFNAVCNFSM6AAAAABCKIG572VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGQYDCOJTGU . You are receiving this because you authored the thread.Message ID: @.***>