m ((username removed) (log details removed)) |
No edit summary |
||
Line 24: | Line 24: | ||
==== Changing the logo ==== | ==== Changing the logo ==== | ||
To use a logo that you have uploaded to the wiki, you can add its path as the image source. | To use a logo that you have uploaded to the wiki, you can add its path as the image source. For example: <syntaxhighlight lang="text"> | ||
<img src="/w/nsfr_img_auth.php/c/c9/mycompany-logo.jpeg" width="150px" alt="MyCompany logo"/> | |||
</syntaxhighlight>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:<syntaxhighlight lang="text"> | |||
{{{content}}} | |||
</syntaxhighlight>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:<syntaxhighlight lang="text"> | |||
{{{content}}} | |||
</syntaxhighlight> | |||
[[File:mail custom text.png|alt=Source view of the singleNotification template with added custom text.|center|thumb|750x750px|SingleNotification custom text]] | |||
After saving the changes, | 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. | |||
[[File:single notification template output.png|alt=Email template preview with highlighted customization|center|thumb|450x450px|Output after customization]] | |||
== Testing the templates == | == 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. | To test changes to the single notification template, wiki admins can use the page ''Special:NotificationTester'' and follow the instructions on the page. |
Revision as of 14:56, 11 July 2024
Starting with BlueSpice 4.5, you can customize the email templates for notifications directly in the wiki.
Since the customizations need to be done in source editing mode, an understanding of wikitext, html and css is required.
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.
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 a 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.
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.