Custom Reply Template

From DocWiki

(Difference between revisions)
Jump to: navigation, search
m (1 revision)

Revision as of 18:55, 21 March 2012

Use the code below to create a custom reply template.

Copy the code, paste it to your SM server, and replace all instances of <SocialMinerServerAddress> with the address of your SM server.

<?xml version="1.0" encoding="UTF-8"?>

This sample code is intended to be used as a simple starting point for creating your own custom reply template.
Modifications to the XML structure should not be required and may result in your custom template failing to load properly.
<ModulePrefs title="Custom Reply Template Sample"
         author="Cisco Systems, Inc."
<Require feature="dynamic-height"/>
<Require feature="settitle"/>
<Require feature="minimessage"/>
<Require feature="setprefs"/>
<Content type="html">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
	<!-- Provide your custom reply template code below. --> 
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<!-- Default CSS includes to provide uniform look and feel. -->
		<link rel="stylesheet" type="text/css" href="http://<SocialMinerServerAddress>/css/ccp.css"  />
		<link rel="stylesheet" type="text/css" href="http://<SocialMinerServerAddress>/css/reply.css" />
		<!-- Required Javascript includes to provide base reply template functionality including the closeTemplate() function. -->
		<script type='text/javascript' src='http://<SocialMinerServerAddress>/templates/reply/js/ccp-session.js'></script>
		<script type='text/javascript' src='http://<SocialMinerServerAddress>/templates/reply/js/template-utils.js'></script>
		<script type='text/javascript'>
			//Set up the required ccpSession object.
			var ccpSession = null;
			ccpSession = new CcpSession(window.location.href);
			function processCustomReply(message) {
				//Provide your custom reply logic here.
				//Note: The alert below only serves as a placeholder and can be removed or modified as needed. 
				alert('Processing message \'' + message + '\'!');
				//Close the reply template and set the Social Contact state to 'handled'.
		<div id="reply">
				<table style="width:100%">
							<table style="width:100%">
										<div id="title">Custom Reply Template Sample</div>
										<div id="description">This is a sample of a Custom Reply Template</div>
							<table style="width:100%">
										<textarea id="replyTextarea" width="150" height="100"></textarea>
										<!-- Sample buttons which invoke Javascript to handle click events. -->
										<!-- When clicked, reply button calls processCustomReply() function and passes in the current value of replyTextArea. -->
										<input id="customreply" type="button" value="Reply" onclick="processCustomReply(document.getElementById('replyTextarea').value);">
										<!-- When clicked, cancel button calls closeTemplate() with a value of  'unread' to unreserve the Social Contact. -->
										<input id="cancel" type="button" value="Cancel" onclick="javascript:closeTemplate('unread')">

Rating: 1.5/5 (2 votes cast)

Personal tools