Line 1,152:
Line 1,152:
|__CHECK_READ__
|__CHECK_READ__
|
|
−
|Insert a blank image with a callback URL to Dolibarr (/public/emailing/mailing-read.php?tag=)
+
|In emailings, insert a blank image with a callback URL to Dolibarr (/public/emailing/mailing-read.php?tag=)
+
|
+
|-
+
|__UNSUBSCRIBE__
+
|
+
|In emailings, insert a link to allow a recipient to unsubscribe from emailings. If the recipient (third party or contact) unsubscribes, his status will change to "Refuse bulk emailings"
+
To setup the wording of:
+
+
- the mention in your email for unsubscribing: Translation (key : MailUnsubcribe)
+
+
- the landing page after unsubscribing: Translation (key: YourMailUnsubcribeOK)
|
|
|}
|}
Line 1,158:
Line 1,168:
*
*
−
=Custom substitution variables=
+
=Substitution variables provide by external module=
Custom substitution variables can be added by external modules.
Custom substitution variables can be added by external modules.
−
For this, the external module must embed a file called '''mymodule/core/substitutions/functions_mymodules.lib.php''' and set the
+
For this, the external module must embed a file called '''mymodule/core/substitutions/functions_mymodules.lib.php''' and set the
−
<code>->module_parts['substitutions'] = 1 </code>
+
+
<code>$this->module_parts['substitutions'] = 1 </code>
+
into the module descriptor.
into the module descriptor.
−
= How it work =
+
=How it work=
The array to define all substitution variables is defined in code by calling the method
The array to define all substitution variables is defined in code by calling the method
<code>$substitutionarray = getCommonSubstitutionArray().</code>
<code>$substitutionarray = getCommonSubstitutionArray().</code>
−
This method receive the $object in parameter, so it can define the content of the substitution array using properties of this object.
+
This method receive the $object in parameter, so it can define the content of the substitution array using properties of this object. No database access and no IO are allowed to set the substitution array.
Then the array will be used by calling the make_substitutions() this way:
Then the array will be used by calling the make_substitutions() this way:
<code>$textcompleted = make_substitutions($textwithsubtitutionkeys, $substitutionarray)</code>
<code>$textcompleted = make_substitutions($textwithsubtitutionkeys, $substitutionarray)</code>
+
However, sometimes to value to use is not available into the $object, neither into the environment, and it needs a database access to get the value.
However, sometimes to value to use is not available into the $object, neither into the environment, and it needs a database access to get the value.