Line 7: Line 7:
 
All the other configuration settings can be done inside the PostHandler PHP file. ( <code>FlexForm/src/Modules/Handlers/phpList/PostHandler.php</code> )
 
All the other configuration settings can be done inside the PostHandler PHP file. ( <code>FlexForm/src/Modules/Handlers/phpList/PostHandler.php</code> )
  
<syntaxhighlight language=php">
+
<syntaxhighlight lang="php">
private const HTML = 1;
+
HTML = 1; // Let subscriber receive email in HTML format
  
private const PHP_LIST_URL = '<nowiki>https://nwi.wikibase.nl/lists'</nowiki>;
+
PHP_LIST_URL = 'Full url to where you have installed PHPList e.g. https://example.com/list';
  
private const FIELD_EMAIL = 'email';
+
FIELD_EMAIL = 'email'; // Name of the form field holding the email of the subscriber
  
private const FIELD_NAME = 'name';
+
FIELD_NAME = 'name'; // Name of the form field holding the name of the subscriber
  
private const FIELD_AS_EMAIL = 'useFieldAsEmail';
+
FIELD_AS_EMAIL = 'useFieldAsEmail'; // Name of a form field where its value holds the name of another form field holding the email of the subscriber
  
private const FIELD_AS_NAME = 'useFieldAsName';
+
FIELD_AS_NAME = 'useFieldAsName'; // Name of a form field where its value holds the name of another form field holding the name of the subscriber
  
private const DEFAULT_LISTS = [
+
// If the form holds no information on what list to subscribe to, the subscribe the user to the following lists by default.
 +
DEFAULT_LISTS = [
  
 
   3 => 'signup',
 
   3 => 'signup',

Revision as of 22:20, 30 March 2023

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 )

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

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

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

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

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

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

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

   3 => 'signup',

   4 => 'signup',

   5 => 'signup',

   6 => 'signup',

   7 => 'signup',

   8 => 'signup'

];