I have the following situation. A school website must send e-mails to pupils, teachers, parents etc, in order to tell them to register for the website. In Dutch, as in many other languages, there are two different forms of the 2nd person of the personal ('you') and possessive ('your') pronouns, viz. the "polite form" and the "informal form", depending on things like the age of the person addressed, relationship between sender and addressee, etc. Even the exact verb forms may be influenced by this. Other languages may be even much more complicated; for background information, please refer to http://en.wikipedia.org/wiki/T-V_distinction.
Of course, the recipient's e-mail address uniquely determines the wording to be used. But that would mean that for a hundred or more recipients several extra parameters must be defined (personal pronoun nominative, dative and accusative, possessive pronoun, verb forms depending on the personal pronoun, etc.), each of which can only have two different values, which is a lot of extra work and is error-prone (possibly causing impolite effects).
In short, what I would appreciate to have is a facility that allows me to specify, in addition to the current the personal data, one parameter per person determining whether or not the "informal" form should be used, and another list detemining what to use for either of these forms.
Example:
Code: Select all
array ("john.doe@here.tld" => array ("{name}" => "John Doe", "{formal}" => "[pol]"),
"peter.johnson@elsewhere.tld" => array ("{name}" => "Peter Johnson", "{formal}" => "[inf]"),
etc.Code: Select all
array ("{u_je}" => array ("[pol]" => "u", "[inf]" => "je"), // pers. pron., unstressed
"{u_jij}" => array ("[pol]" => "u", "[inf]" => "jij"), // pers. pron., stressed, nominative
"{u_jou}" => array ("[pol]" => "u", "[inf]" => "jou"), // pers. pron., stressed, dative/accusative
"{uw_jouw}" => array ("[pol]" => "uw", "[inf]" => "jouw"), // poss. pron.
"{hebt_heb}" => array ("[pol]" => "hebt", "[inf]" => "heb"), // verb form
"{kunt_kun}" => array ("[pol]" => "kunt", "[inf]" => "kun"), // verb form
etc.or something like this. (The exact entries will of course depend on the actual text.)
In the decorator as it is now, I should specify all of these parameters for every single recipient, which is a lot of extra work and is error-prone (possibly causing impolite effects).
In short: there is a need for more parameters, which do not depend on the exact person, but on the category he belongs to. (Many more applications are possible. Think of address change notices, where some recipients must be informed about your undisclosed phone number, or you company phone number, while others should not.)
The only way I see now, is to use a separate PHP function that first chooses the correct pronouns and verb forms (generally: the correct category-dependent values), and then automatically builds the array for the decorator. But this will most likely undo the advantages of the clever cache useage by SwiftMailer, implying that the entire Decorator is not of much use and the desired effects can also be simply obtained by the PHP function str_replace().
What I am asking, is in fact a "two-level replacement". I am aware that you will not have this available "tomorrow". But if you manage to realise something like this, it will make SwiftMailer extra attractive to be used with foreign languages.