How to Modify the MailReason.xsl to Display Different Greetings for Different User Groups
Question
How to configure the Greetings in some Alma letters based on Patron User Groups.
Answer
You will need to modify the MailReason.xsl letter.
- Go to Alma Configuration > General > General Configuration > Customize Letters
- Find the MailReason.xsl
- Customize (or edit) the letter and save
Example of MailReason.xsl with modified greetings:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template name="toWhomIsConcerned">
<table cellspacing="0"
cellpadding="5"
border="0">
<tr>
<td>
<xsl:for-each select="notification_data">
<xsl:if test="receivers/receiver/user/user_group = 'STU'">
<h3>
<h3>Dear Student Dr. <xsl:value-of select="receivers/receiver/user/last_name"/>
</h3> </h3>
</xsl:if>
<xsl:if test="receivers/receiver/user/user_group = 'RES'">
<h3>
<h3>Dear Dr. <xsl:value-of select="receivers/receiver/user/last_name"/>
</h3> </h3>
</xsl:if>
<xsl:if test="receivers/receiver/user/user_group = 'FAC'">
<h3>
<h3>Dear Dr. <xsl:value-of select="receivers/receiver/user/last_name"/>
</h3> </h3>
</xsl:if>
<xsl:if test="receivers/receiver/user/user_group = 'STA'">
<h3>
<h3>Dear <xsl:value-of select="receivers/receiver/user/first_name"/> <xsl:value-of select="receivers/receiver/user/last_name"/>
</h3> </h3>
</xsl:if>
<xsl:if test="receivers/receiver/user/user_group = ''">
<h3>@@dear@@ <xsl:value-of select="receivers/receiver/user/first_name"/>
</h3>
</xsl:if>
</xsl:for-each>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>