Trimech-Main-Site-Group-Navigation Trimech-Main-Site-Group-Navigation Trimech-Main-Site-Group-Navigation Solid-Solutions-Group-Navigation Javelin-Group-Navigation Solid-Print-Group-Navigation 3DPRINTUK-Group-Navigation Trimech-Enterprise-Solutions-Group-Navigation Trimech-Enterprise-Solutions-Group-Navigation Trimech-Advanced-Manufacturing-Group-Navigation Trimech-Staffing-Solutions-Group-Navigation
With over 35 years of experience, the TriMech Group offers a comprehensive range of design, engineering, staffing and manufacturing solutions backed by experience and expertise that is unrivalled in the industry. The TriMech Group's solutions are delivered by the divisions and brands shown here, use the links above to visit the group's websites and learn more.
x
Search

Data Management: How to Customise Notification Templates in SOLIDWORKS PDM

Wednesday October 18, 2023 at 8:00am
Save 30% on SOLIDWORKS - View Limited Time Offer

Customising email notifications in SOLIDWORKS PDM became substantially easier with the 2023 release of SOLIDWORKS.

It was always possible to make some minor changes to notification templates, but the process was fraught with limitations and some frustration when after each upgrade, your changes were reset back to the defaults.

These days, with just a little bit of HTML coding, it's straightforward to create clear and structured notifications in SOLIDWORKS PDM.

Let’s show you some of the basics of customising notifications in SOLIDWORKS PDM, such as adding a new variable column and changing the colour of selected fonts.

We’ll also go a step further to show you a great way of adding a company logo or other image to the email template without having to host that image externally (and potentially have it blocked from displaying in your email client by default).

CONTENTS

  1. How to Customise Notifications in SOLIDWORKS PDM
  2. Default Templates for SOLIDWORKS PDM Notifications
  3. How to Change Colours in SOLIDWORKS PDM Notifications
  4. How to Add Variables to SOLIDWORKS PDM Notifications
  5. How to Add Images to Notifications in SOLIDWORKS PDM

How to Customise PDM Notification Templates

SOLIDWORKS PDM (2023 and onwards) provides administrators with the option to customise the templates used for automatic notifications sent via SMTP and DataBase mail within your PDM vault.

This will allow you to include additional information that may be more useful to the user.

Before we begin however, you will first need to ensure that you have the update mail configuration administrative permission enabled.

Although the most common type of notification we see is Changed State, notifications can be triggered for a number of reasons, and we are able to customise the full range of templates used when files are:

  • Added
  • Changed State
  • Checked In
  • Checked Out
  • Delayed in State

These are shown within the Notification Templates node within the Administration Tool in SOLIDWORKS PDM.

After selecting the template you wish to modify, you will have the option to edit both the subject and body in HTML format, including the insertion of Card Variables within the notification message.

Thinking about upgrading? Find the best CAD workstation for you with our range of Dell hardware.
Learn More

This is done using the flyout menu in the Customise window alongside the subject and body text boxes.

To access the Customise dialog box you can simply double click the notification template that you wish to edit.

Within the form there are a number of sections:

  • Name is a read-only field that displays the name of the notification template.
  • Preview displays how the template appears to users.
  • Template allows selection of either notification template option to Default or Custom.

If you select Custom, the fields listed below are enabled to enable you to customize the notification template.

  • Subject displays and allows for the notification subject to be edited. To include variables, click the chevron icon and select a required variable.
  • Body displays and allows for the notification body to be edited. To include variables, click the chevron icon and select a variable.
  • Load from File imports HTML text into the body of the notification.
  • Reset will restore the notification template to the default template.

For offline editing in a standalone editor, you can export notification templates.

Whilst it is possible to export all via a single right click over the notification templates node, as we want to look specifically at the Changed State template, we will want to drill down to that specific template, right-click and select Export.

We’ll create a customised state change notification that looks like this:

The Default Template

Let’s look at the default state change notification in the preview.

We can see that that there are number of sections.

The header includes a coloured cell with white text followed by two lines that describe the reason for the notification.

The main body contains a repeat block table where additional rows will be added for each file.

We must be cautious when modifying this table not to delete the hyperlinks as there is some underlying code linked to each of those hyperlinks that it would be unwise to change.

NOTE: Clicking in the filename column ‘opens’ the file in its default editor and clicking in the ‘View’ column opens it in its default viewer.

For many files, this would be the same application, so you may choose to remove ‘View’ completely – the difference being the checkout prompt.

The footer section currently displays the notification and state change comments added by the user at the point the transition was triggered.

If you are new to HTML, then modifying the code can be a bit daunting, but it reads top to bottom, and we’re able to find and change the sections we want with a bit of trial and error.

Did you know?

Our SOLIDWORKS training courses teach you everything you need to know to pass your SOLIDWORKS certification exams.

Solid Solutions customers with an Enhanced SOLIDWORKS Subscription also gain access to our SOLIDWORKS skills assessment tool. Use it to test your SOLIDWORKS skills and identify areas where your knowledge could be improved!

How to Change Colours in SOLIDWORKS PDM Notifications

Let’s begin by changing the colour block in the header to the blue of Solid Solutions.

In HTML, colours are described as a hexadecimal code or by RGB values. This is something you can easily get with a colour picker or through MS Word or an image editor.

In the Solid Solutions branding, the blue has a hex value of #1D4F91 and the grey #BFBFC3.

Looking at the code, we see a section near the top that contains the text, “SOLIDWORKS PDM Notification”.

This suggests that this is that pale blue block. In there we see a Background-color tag and after changing that to #1D4F91 and opening the preview we see we made the change correctly.

<div style="background-color: #1D4F91; font-size: 20px;color: white; padding: 13px; text-align: center">
<font face="Arial">SOLIDWORKS PDM notification</font>
</div>

How to Add Variables to SOLIDWORKS PDM Notifications

Next, we want to add a Description column to the table. We can change the variables displayed and the font styles used in a table.

We’ll modify the code layout to make it easier to follow by adding some carriage returns between the <td> and </td> tags that define each Table Data cell.

We can then add an extra cell by copying and pasting a line from a <td> element, and renaming it to Description as in the image above. We can also change the colour too by swapping over the hex value.

Check the preview after making changes. We can see this has updated to reflect the new code and shows that we now have an extra header cell called ‘Description’, but we still need to insert the description variable into the body between the File Name and the View text.

We’ll copy a <td> element within the repeat block, then insert the required Variable from the flyout menu.

Decide if you want the URL to ‘Open’, ‘View’ or ‘Browse to’ the target file. In this example we have set it as open.

We’ll repeat the font colour changes on the fixed text in the footer, and we can also copy the HMTL for the line break that was above State Change Comment to also appear above Notification Comment.

Line break code: <hr class="line1">

How to Add an Image to SOLIDWORKS PDM Notifications

Finally, we will add an image to our SOLIDWORKS PDM notification.

The Solid Solutions logo will look great in the header.

There are a couple of options for inserting images. We mentioned earlier that in a typical webpage, when an image is displayed it is loaded in via HTML code that points to a specific location (HREF).

So, one option would be to add our logo to a public location on our website, or even in a file sharing platform such as Google Drive.

After uploading and setting the share options for the image you would need to extract the specific share URL.

If the original URL is:

https://drive.google.com/file/d/0B6wwyazyzml-OGQ3VUo0Z2thdmc/view

You would copy the ID from the original URL (the characters between the /d/ and /view), and use it in this URL:

https://drive.google.com/uc?export=view&id=0B6wwyazyzml-OGQ3VUo0Z2thdmc

The formatting within the notification could then look something like this:

<body>
<img src="https://drive.google.com/uc?export=view&id=0B6wwyazyzml-OGQ3VUo0Z2thdmc">
<br>
<a href="https://drive.google.com/uc?export=download&id=0B6wwyazyzml-OGQ3VUo0Z2thdmc" download>Download</a>
</body>

This method requires a reasonable amount of housekeeping for something that may just be a small logo.

So, instead we suggest embedding the image directly into the code, by converting it to Base64 code.

NOTE: We should be clear though that Base64 is only useful for very small images.

Base64 is an encoding algorithm that converts any characters, binary data, plus images or sound files into a readable string, which can then be saved or transported over a network without data loss.

The characters generated from Base64 encoding consist of Latin letters, digits, plus, and slashes.

When it comes to larger images, the encoded size of a picture in bytes will end up being much larger than JPEGs or PNG files.

This can result in slow page load times and an increased amount of bandwidth usage when the notification is sent.

Thinking about upgrading? Find the best CAD workstation for you with our range of Dell hardware.
Learn More

There are lots of tools online to convert an image to Base64 and we obviously can’t vouch for all of them. In this example we used https://www.base64-image.de/ which created an 11 KB code snippet.

Once you have the code, you can then insert it into the HTML wrapped in an <img> element with any additional formatting you want to include.

Here we’ve set the image alignment to be centred, then revert back to left alignment after the inserted code snippet. We also added an alt tag to provide support for screen reader software.

The preview looks good, but you will note the image is quite large.

Base64 images will be sized in pixels as per the source image, but you can also include Width and Height values within a style tag if preferred.

EXAMPLE
<img src="'data:image/png;base64,' + your_base64_string" style="width:50px;height:250px">

Now whenever a file changes state we’ll be greeted with this notification, and the customised layout will carry forward to future versions as you update and upgrade SOLIDWORKS.

Take the Next Steps

Master SOLIDWORKS PDM with expert-led courses that help you boost your skills and confidence. You can attend online or in a classroom near you!

Choose from a huge range of professional SOLIDWORKS and CATIA training courses and save on multiple courses with a Training Passport.

Related Blog Posts

Beyond Optimum: Getting the Best from Simulation
Discover the principles of design optimisation and how the 'best' may not be the only solution...
Automation of SWOOD Nesting
Automate SWOOD Nesting to boost efficiency, cut waste, and streamline CNC workflows, saving time and costs while scaling production with precision.
A Part Inside a Part? The Basics of Master Modelli
Learn more about the master modelling technique, used to create references to existing parts to ensure adequate fit.

 Solid Solutions | Trimech Group

MENU
Top