No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Starting with BlueSpice 4.5, you can customize the email templates for notifications directly in the wiki. | Starting with BlueSpice 4.5, you can customize the email templates for notifications directly in the wiki. | ||
== Customizing the notification emails == | == Customizing the notification emails == | ||
Line 10: | Line 8: | ||
* <code>MediaWiki:DigestNotification.mail</code>: Content for the daily or weekly digest notifications. | * <code>MediaWiki:DigestNotification.mail</code>: Content for the daily or weekly digest notifications. | ||
[[File:mail template.png|alt=Template output with outside wrapper and inside content template|center|thumb|550x550px|Notification mail template]] | [[File:mail template.png|alt=Template output with outside wrapper and inside content template|center|thumb|550x550px|Notification mail template]]Since the customizations need to be done in source editing mode, an understanding of wikitext, html and css is required. | ||
=== MediaWiki:Wrapper.mail === | === MediaWiki:Wrapper.mail === | ||
Line 39: | Line 37: | ||
You could also embed this new content as a [[mediawikiwiki:Help:System_message|system message]] if you know how system messages work. This would ensure that users see this text in the language that they defined in their preferences. | |||
You could also embed this new content as a[[mediawikiwiki:Help:System_message|system message]] if you know how system messages work. This would ensure that users see this text in the language that they defined in their preferences. | |||
After saving the changes, you see the updated template. Please note that clicking on this email link will cause a security error in the wiki, but not in the actual email that is sent. | After saving the changes, you see the updated template. Please note that clicking on this email link will cause a security error in the wiki, but not in the actual email that is sent. |
Revision as of 14:57, 11 July 2024
Starting with BlueSpice 4.5, you can customize the email templates for notifications directly in the wiki.
Customizing the notification emails
Three templates are used for the emails:
MediaWiki:Wrapper.mail
: As the name says, this template wraps the actual email text. Here, you can change the logo.MediaWiki:SingleNotification.mail
: Content for the instant notifications.MediaWiki:DigestNotification.mail
: Content for the daily or weekly digest notifications.
Since the customizations need to be done in source editing mode, an understanding of wikitext, html and css is required.
MediaWiki:Wrapper.mail
The mail wrapper contains the overall styling of the email. Here, you can set the logo that is used in the email body. By default, the emails display the logo that is defined inFlexiSkin.
The wiki shows a preview of the current email layout. You can edit this page in source editing mode. The layout is generated by a combination of html container elements that wrap around the parameter "Content". Like with every wiki page, you create a version history of your changes and it is easy to revert to the original layout if needed.
The HTML "head"-tag defines some meta information and does not need to be changed.
In the "body"-tag, the background color and content padding is set. If you do not use FlexiSkin or have a custom template defined on the server, the background is white.
The first div-container wraps around the logo. It contains some styles that are predefined in the wiki's skin, but could be overwritten. Since the text color is usually black or a dark grey, we can usually leave all the custom settings as is.
Changing the logo
To use a logo that you have uploaded to the wiki, you can add its path as the image source. For example:
<img src="/w/nsfr_img_auth.php/c/c9/mycompany-logo.jpeg" width="150px" alt="MyCompany logo"/>
When you edit this page, make sure not to remove the content placeholder. This placeholder is required to add the actual email text from single or the digest notification email template and looks like this:
{{{content}}}
Let's switch to the content templates.
MediaWiki:SingleNotification.mail
The single notification template sends out an email immediately after a triggering event. Since this template is used for all kinds of notifications, you shoul leave the default content alone in most cases. But you can add additional content for example.
Here, I add the contact and email information of the wiki administrator in case there are questions about the notification emails right between the two HTML "div"-containers. This places the new content above the grey footer box:
{{{content}}}
You could also embed this new content as asystem message if you know how system messages work. This would ensure that users see this text in the language that they defined in their preferences.
After saving the changes, you see the updated template. Please note that clicking on this email link will cause a security error in the wiki, but not in the actual email that is sent.
Testing the templates
To test changes to the single notification template, wiki admins can use the page Special:NotificationTester and follow the instructions on the page.