Master Data Services 2012 - Change Mail Layout

Answered Master Data Services 2012 - Change Mail Layout

  • Tuesday, March 05, 2013 7:33 PM
     
      Has Code

    Hi everyone,

    Here's my problem. I'm in a final development of MDS 2012 and my problem is with send mail for notifications.

    MDS does have his own layout in [mdm].[tblSystemSetting] field settingname, 'ValidationIssueHTML'.

    The problem is, every time I change some things and put into database (the new layout), the task doesn't work and doesn't give any error messages (or I don't know where to look for these error messages).

    Heres the default layout (works like a charm):

    <?xml version="1.0"?>  
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
      <xsl:variable name="rootUrl" select="root/header/root_url"/>  
      <xsl:template match="/">  
        <html>  
          <style type="text/css">  
             .style1 {  
                 font-family: Verdana, Arial, Helvetica, sans-serif;  
                 font-size: 10px;  
                 font-weight: bold;  
             }  
             .style3 {  
                font-size: 10px;   
                font-family: Verdana, Arial, Helvetica, sans-serif;   
             }  
          </style>  
          <img>  
            <xsl:attribute name="src">  
              <xsl:value-of select="$rootUrl"/>/images/logo.jpg  
            </xsl:attribute>  
          </img>  
          <p>  
            <span class="style1">  
              <xsl:value-of select="root/header/Notification_type"/>  
            </span>  
          </p>  
          <table class="style3" border="0">  
              <tr class="style1">  
                <th>  
                  <xsl:value-of select="root/header/id"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/Model"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/Version"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/Entity"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/MemberCode"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/Message"/>  
                </th>  
                <th>  
                  <xsl:value-of select="root/header/Issued"/>  
                </th>  
              </tr>  
              <xsl:for-each select="//notification">  
                <tr>  
                  <td>  
                    <xsl:value-of select="id"/>  
                  </td>  
                  <td>  
                    <xsl:value-of select="model"/>  
                  </td>  
                  <td>  
                    <xsl:value-of select="version"/>  
                  </td>  
                  <td>  
                    <xsl:value-of select="entity"/>  
                  </td>  
                  <td>  
                    <xsl:value-of select="member_code"/>  
                  </td>  
                  <td>  
                    <a>  
                      <xsl:attribute name="href">  
                        <xsl:value-of select="$rootUrl"/>/Redirect.aspx?mid=<xsl:value-of select="model_id"/>&amp;vid=<xsl:value-of select="version_id"/>&amp;eid=<xsl:value-of select="entity_id"/>&amp;meid=<xsl:value-of select="member_id"/>&amp;mtid=<xsl:value-of select="member_type_id"/>  
                      </xsl:attribute>  
                      If <xsl:value-of select="condition_text"/> Then <xsl:value-of select="action_text"/>  
                    </a>  
                  </td>  
                  <td>  
                    <xsl:value-of select="issued"/>  
                  </td>  
                </tr>  
              </xsl:for-each>  
          </table>  
          <p class="style3">  
              <xsl:value-of select="root/truncated_message"/>  
          </p>  
        </html>  
      </xsl:template>  
    </xsl:stylesheet>


    Heres my layout (just doesnt work):

    <?xml version="1.0"?>  
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">  
    	<xsl:variable name="rootUrl" select="root/header/root_url"/>  
    	<xsl:template match="/">  
        <html>  
    		 <style type="text/css">  
    			.style1 {  
    				 font-family: Verdana;  
    				 font-size: 10px;  
    				 font-weight: bold; 
    				 color:#FFF;
    			}  
    			
    			.style2{
    				 color:#736B78;
    				 font-family: verdana;
    			}
    			
    			.style3 {  
    				font-size: 12px;   
    				font-family: Verdana;
    				color:#233C52;
    				
    			}  
    			
    			.style4{
    				 border-color:#666;
    				 border-style:solid;
    				 border-width:1px;
    				 width:920px;
    				 padding:20px 20px 20px 20px;
    				
    			}
    			.style5{
    				 font-family: Neo Sans Intel, Verdana;
    				 color:#233C52;
    			}
    			
    			.style6 {  
    				font-size: 8px;   
    				font-family: Verdana;
    				color:#233C52;
    				
    			}
    			
    			.style7 {  
    				font-size: 10px;   
    				font-family: Verdana;
    				color:#233C52;
    				
    			}
    		</style>  
    		<table align="center" class="style4">
    			<tr>
    				<td width="117" valign="bottom">	
    					<p>
    						<img width="84" height="56" align="top">
    							<xsl:attribute name="src">  
    								<xsl:value-of select="$rootUrl"/>/images/logo.jpg
    							</xsl:attribute>  
    						</img>
    					</p>
    				</td>
    				<td class="style5" width="799" valign="bottom">
    					Master Data Services
    				</td>
    			</tr>
    			<tr>
    				 <td colspan="2" align="center">
    					<p>
    						&nbsp;
    					</p>
    					<p>
    						&nbsp;
    					</p>
    				 </td>
    			</tr>
    			<tr>
    				<td height="80" colspan="2" valign="top">
    					<p class="style3">
    						Model: Example Model
    					</p>
    					<p class="style3">
    						This email show issues with validation on some entities on Master Data Services. Below you can see all details of entities with issues and so correct them.
    					</p>
    				</td>
    			</tr>
    			<tr>
    			  <td colspan="2">
    				  <table width="900" border="0">
    					<tr bgcolor="#7F7F7F" class="style1">
    						<th width="210" align="center">Entity</th>
    						<th width="350" align="center">Member Code</th>
    						<th width="340" align="center">Validation Message</th>
    					</tr>
    					<xsl:for-each select="//notification">
    						<tr bgcolor="#D9D9D9" align="left" border="0" class="style7">
    							<td width="210">
    								<xsl:value-of select="entity"/> 
    							</td>
    							<td width="350">
    								<xsl:value-of select="member_code"/> 
    							</td>
    							<td width="340">
    								<xsl:value-of select="action_text"/>
    							</td>
    						</tr>
    					</xsl:for-each>
    				  </table>
    			  </td>
    			</tr>
    			<tr>
    			  <td colspan="2" align="center"><p>&nbsp;</p>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    				<p>&nbsp;</p>
    			  <p class="style6">Copyrights Company 2013</p></td>
    			</tr>
    		</table>
    		<p class="style3">  
    
    		</p>  
    	</html>
    	</xsl:template>  
    </xsl:stylesheet>


    Thanks for your time and help

All Replies

  • Thursday, March 07, 2013 2:38 PM
     
     Answered

    Problem solved.

    Seems like XSLT does not accept $nbsp; as character. Had to change to &#10;

    Att

    • Marked As Answer by Cunha, Rafael Thursday, March 07, 2013 2:38 PM
    •