Extension name : phpList

Allows for subscribing a user to your instalment of PHPList. ( https://www.phplist.org )

PHPList needs a name and an email address as a bare minimum, so a form should provide that information.

All the other configuration settings can be done inside the PostHandler PHP file. ( FlexForm/src/Modules/Handlers/phpList/PostHandler.php )

// Let subscriber receive email in HTML format
HTML = 1;

// Full url to where you have installed PHPList e.g. https://example.com/list
PHP_LIST_URL = '';

// Name of the form field holding the email of the subscriber
FIELD_EMAIL = 'email';

// Name of the form field holding the name of the subscriber
FIELD_NAME = 'name'; 

// Name of a form field where its value holds the name of another form field holding the email of the subscriber
FIELD_AS_EMAIL = 'useFieldAsEmail'; 

// Name of a form field where its value holds the name of another form field holding the name of the subscriber
FIELD_AS_NAME = 'useFieldAsName'; 

// If the form holds no information on what list to subscribe to, then subscribe the user to the following lists by default.
DEFAULT_LISTS = [

   3 => 'signup',

   4 => 'signup',

   5 => 'signup',

   6 => 'signup',

   7 => 'signup',

   8 => 'signup'

];

Note: We will be updating the use of extensions in the next release, so when updating you will not lose your custom settings.

Update for FlexForm v2.1.1

All settings have been taken from the PostHandler.php file. FlexForm extension handler class has been updated to include config settings from the localsettings. See Extensions.

The settings now need to be setup in your localsettings. Example :

// Let subscriber receive email in HTML format
$wgFlexFormConfig['extensions']['phpList']['HTML'] = 1;

// Full url to where you have installed PHPList e.g. https://example.com/list
$wgFlexFormConfig['extensions']['phpList']['PHP_LIST_URL'] = '';

// Name of the form field holding the email of the subscriber
$wgFlexFormConfig['extensions']['phpList']['FIELD_EMAIL'] = 'email';

// Name of the form field holding the name of the subscriber
$wgFlexFormConfig['extensions']['phpList']['FIELD_NAME'] = 'name';

// Name of a form field where its value holds the name of another form field holding the email of the subscriber
$wgFlexFormConfig['extensions']['phpList']['FIELD_AS_EMAIL'] = 'useThisFieldAsEmail';

// Name of a form field where its value holds the name of another form field holding the name of the subscriber
$wgFlexFormConfig['extensions']['phpList']['FIELD_AS_NAME'] = 'useThisFieldAsName';

// Since v2.1.3: Name of a form field that needs to be submitted for the extension to do anything. This can be e.g. a checkbox (see example below). When checked the field will be submitted and 
// phpList extension will only then subscribe a user. If you leave this setting out or empty, then no such check will be done.
$wgFlexFormConfig['extensions']['phpList']['NEEDS_THIS_FIELD'] = 'onlyAddIfThisFieldExists';

// If the form holds no information on what list to subscribe to, then subscribe the user to the following lists by default.
$wgFlexFormConfig['extensions']['phpList']['DEFAULT_LISTS'] = [
	3 => 'signup',
	4 => 'signup',
	5 => 'signup',
	6 => 'signup',
	7 => 'signup',
	8 => 'signup'
];

// As of v2.1.4 lists are defined by only their id:
$wgFlexFormConfig['extensions']['phpList']['DEFAULT_LISTS'] = [ 3, 4, 5, 6, 7, 8 ];

Example form

<form extension="phpList">
   Name: <input type="text" name="naam" /><br>
   Email: <input type="email" name="e-mail" /><br>
   <input type="secure" name="useThisFieldAsName" value="naam" />
   <input type="secure" name="useThisFieldAsEmail" value="e-mail" />
   <input type="checkbox" name="onlyAddIfThisFieldExists" checked="checked" value="kk" />&nbsp; Sign me up for the newsletters<br>
   <input type="submit" value="register" />
</form>