View Issue Details

IDProjectCategoryView StatusLast Update
0019297phpList 3 applicationInterface - Backendpublic31-05-19 12:31
Reporterdparts 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version3.3.3 
Target VersionFixed in Version 
Summary0019297: Add missing transaction messages for other languages (Fix inside)
DescriptionThere are no transaction messages used in other languages for updatemessage, emailchanged_text, emailchanged_text_oldaddress, updatesubject.

To get transaction messages in other languages we need to add the ID of each subscription page to subscribelib2.php.

To edit and store these messages we need to edit spageedit.php.

Attached you can find my diff files for this change.
TagsNo tags attached.

Relationships

related to 0019953 new Add support for translating transactional messages 

Activities

dparts

23-06-18 11:36

reporter  

spageedit.php.diff (3,396 bytes)
73a74,79
> 				 'updatesubject',
> 				 'updatemessage',
> 				 'emailchanged_text',
> 				 'emailchanged_text_oldaddress',
> 				 'personallocation_subject',
> 				 'personallocation_message',
142a149,154
> $data['updatesubject'] = getConfig('updatesubject');
> $data['updatemessage'] = getConfig('updatemessage');
> $data['emailchanged_text'] = getConfig('emailchanged_text');
> $data['emailchanged_text_oldaddress'] = getConfig('emailchanged_text_oldaddress');
> $data['personallocation_subject'] = getConfig('personallocation_subject');
> $data['personallocation_message'] = getConfig('personallocation_message');
179a192,197
> 	$data['updatesubject'] = getConfig("updatesubject:$id");
> 	$data['updatemessage'] = getConfig("updatemessage:$id");
> 	$data['emailchanged_text'] = getConfig("emailchanged_text:$id");
> 	$data['emailchanged_text_oldaddress'] = getConfig("emailchanged_text_oldaddress:$id");
> 	$data['personallocation_subject'] = getConfig("personallocation_subject:$id");
> 	$data['personallocation_message'] = getConfig("personallocation_message:$id");
297c314,335
> $transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Message subscribers receive when they have changed their details').'</h4>';
> $transactionHTML .= sprintf('<label for="updatesubject">%s</label><input type="text" name="updatesubject" value="%s" size="60" />',
>     $GLOBALS['I18N']->get('Subject'),
>     htmlspecialchars(stripslashes($data['updatesubject'])));
> $transactionHTML .= sprintf('<label for="updatemessage">%s</label><textarea name="updatemessage" cols="60" rows="10" class="virtual">%s</textarea>',
>     $GLOBALS['I18N']->get('Message'),
>     htmlspecialchars(stripslashes($data['updatemessage'])));	
> $transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Part of the message that is sent to their new email address when subscribers change their information, and the email address has changed').'</h4>';	
> $transactionHTML .= sprintf('<label for="emailchanged_text">%s</label><textarea name="emailchanged_text" cols="60" rows="10" class="virtual">%s</textarea>',
>     $GLOBALS['I18N']->get('Message'),
>     htmlspecialchars(stripslashes($data['emailchanged_text'])));	
> $transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Part of the message that is sent to their old email address when subscribers change their information, and the email address has changed').'</h4>';	
> $transactionHTML .= sprintf('<label for="emailchanged_text_oldaddress">%s</label><textarea name="emailchanged_text_oldaddress" cols="60" rows="10" class="virtual">%s</textarea>',
>     $GLOBALS['I18N']->get('Message'),
>     htmlspecialchars(stripslashes($data['emailchanged_text_oldaddress'])));		
> $transactionHTML .= '<h4>'.$GLOBALS['I18N']->get('Message to send when they request their personal location').'</h4>';
> $transactionHTML .= sprintf('<label for="personallocation_subject">%s</label><input type="text" name="personallocation_subject" value="%s" size="60" />',
>     $GLOBALS['I18N']->get('Subject'),
>     htmlspecialchars(stripslashes($data['personallocation_subject'])));
> $transactionHTML .= sprintf('<label for="personallocation_message">%s</label><textarea name="personallocation_message" cols="60" rows="10" class="virtual">%s</textarea>',
>     $GLOBALS['I18N']->get('Message'),
>     htmlspecialchars(stripslashes($data['personallocation_message'])));
spageedit.php.diff (3,396 bytes)
subscribelib2.php.diff (1,496 bytes)
620c618
<     $message = str_replace('[LISTS]', $lists, getUserConfig('updatemessage', $userid));
---
>     $message = str_replace('[LISTS]', $lists, getUserConfig("updatemessage:$id", $userid, $id));
623,624c621,622
<         $newaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig('emailchanged_text', $userid), $message);
<         $oldaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig('emailchanged_text_oldaddress', $userid),
---
>         $newaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig("emailchanged_text:$id", $userid), $message, $id);
>         $oldaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig("emailchanged_text_oldaddress:$id", $userid),
634c632
<             if (sendMail($data['email'], getConfig('updatesubject'), $oldaddressmessage, system_messageheaders($email),
---
>             if (sendMail($data['email'], getConfig("updatesubject:$id"), $oldaddressmessage, system_messageheaders($email),
636c634
<                 sendMail($email, getConfig('updatesubject'), $newaddressmessage, system_messageheaders($email),
---
>                 sendMail($email, getConfig("updatesubject:$id"), $newaddressmessage, system_messageheaders($email),
648c646
<             if (sendMail($email, getConfig('updatesubject'), $message, system_messageheaders($email), $envelope)) {
---
>             if (sendMail($email, getConfig("updatesubject:$id"), $message, system_messageheaders($email), $envelope)) {
subscribelib2.php.diff (1,496 bytes)

duncanc

24-06-18 06:42

updater   ~0060769

I'm not sure that you have explained this very well. The changes are to hold some configuration items (update subject, update message etc) for each subscribe page instead of having only one value (on the Settings page).

That will allow customisation and translation of the text for individual subscribe pages.

Is this the intention?

dparts

24-06-18 10:17

reporter   ~0060773

Sorry about that. Yes this is my intention.
For example if we have subscription pages in English, French and German we want to send transaction messages for each language depending from wich subscription page the user subscribed, unsubscribed, changed their preferences, we need to pass the subscription page ID and set the corresponding messages in each languages, otherwise the user will only get transaction messages in the default language as stated in the Settings page.