﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output omit-xml-declaration ="yes"/>

	<xsl:template match="/">
		<xsl:variable name="FirstName" select="normalize-space(AjaxRequest/Params/FirstName)"/>
		<xsl:variable name="PromoteKey" select="normalize-space(AjaxRequest/Params/PromoteKey)"/>
		<xsl:variable name="Ticket" select="normalize-space(AjaxRequest/Params/Ticket)"/>
		<xsl:variable name="Mode" select="normalize-space(AjaxRequest/Params/Mode)"/>
		<xsl:variable name="ItemName" select="normalize-space(AjaxRequest/Params/ItemName)"/>
		<xsl:variable name="ItemID" select="normalize-space(AjaxRequest/Params/ItemID)"/>
		<xsl:variable name="HostName" select="normalize-space(AjaxRequest/HostName)"/>
		<xsl:variable name="Item" select="normalize-space(AjaxRequest/Params/Item)"/>
		<xsl:variable name="IsExistingUser" select="normalize-space(AjaxRequest/Params/IsExistingUser)"/>
		<xsl:variable name="ItemsName" select="normalize-space(AjaxRequest/ItemName)"/>
		<xsl:variable name="ItemImageURL" select="normalize-space(AjaxRequest/ItemImageURL)"/>
		<xsl:variable name="SenderName" select="normalize-space(AjaxRequest/SenderName)"/>

		<div>
			<xsl:if test="$Mode != 'Challenge'">
				<div style="margin:10px;font-family: Calibri, Verdana, Arial;font-size: 10pt;">
					<xsl:value-of select="AjaxRequest/Params/EmailContent" disable-output-escaping ="yes"/>
				</div>
			</xsl:if>
			<xsl:if test="$Mode = 'Brand' or $Mode = 'BrandSuggestedLinks'">
				<div style="margin:10px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						<b>
							View the&#xa0;<xsl:value-of select="$Item"/>&#xa0;Community:
						</b>
						<xsl:choose>
							<xsl:when test="$IsExistingUser = 'True'">
								<a href="http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:otherwise>
						</xsl:choose>
					</span>
				</div>
			</xsl:if>
			<xsl:if test ="$Mode = 'Publication'">
				<div style="margin:10px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						<b>View the Publication: </b>
						<xsl:choose>
							<xsl:when test="$IsExistingUser = 'True'">
								<a href="http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:otherwise>
						</xsl:choose>
					</span>
				</div>
			</xsl:if>
			<xsl:if test ="$Mode = 'Template'">
				<div style="margin:10px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						<b>View the Template: </b>
						<xsl:choose>
							<xsl:when test="$IsExistingUser = 'True'">
								<a href="http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}" target="_blank">
									http://<xsl:value-of select="$HostName"/>/<xsl:value-of select="$PromoteKey"/>
								</a>
							</xsl:otherwise>
						</xsl:choose>
					</span>
				</div>
			</xsl:if>
			<xsl:if test ="$Mode = 'Challenge'">
				<div>
					<table width="100%" cellspacing="0" cellpadding="0" style="width: 100.0%; background: #f2f2f2;padding-bottom:10.5pt;padding-top:10.5pt;">
						<tbody>
							<tr>
								<td>
									<table width="600" cellspacing="0" cellpadding="0" style="width: 100.0%;">
										<tbody>
											<tr>
												<td valign="top" style="padding: 0in 0in 0in 0in; min-height: 10px">
													<div align="center">
														<table width="600" cellspacing="0" cellpadding="0" border="0" style="width: 6.25in;background: #3F3F41">
															<tbody>
																<tr style="min-height: 7.5pt">
																	<td width="25" valign="top" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt">
																		<p style="line-height: 0%;margin:0;">
																			<span>
																				<img border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/LtTop.png" />
																				<u></u>
																				<u></u>
																			</span>
																		</p>
																	</td>
																	<td style="padding: 0in 0in 0in 0in; min-height: 7.5pt">
																		<p style="line-height: 0%;margin:0;">
																			<span style="font-size: 1.0pt">
																				<u></u>
																				<u></u>
																			</span>
																		</p>
																	</td>
																	<td width="25" valign="top" style="width: 18.75pt; padding: 0in 0in 0in 0in; min-height: 7.5pt;min-height: 10px">
																		<p align="right" style="text-align: right; line-height: 0%;margin:0;">
																			<span>
																				<img border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/RtTop.png" />
																				<u></u>
																				<u></u>
																			</span>
																		</p>
																	</td>
																</tr>
																<tr>
																	<td style="padding: 0in 0in 0in 0in">
																	</td>
																	<td style="padding: 0in 0in 0in 2.5pt">
																		<table width="100%" cellspacing="0" cellpadding="0" border="0" style="width: 100.0%">
																			<tbody>
																				<tr>
																					<td style="padding: 0in 0in 0in 0in">
																						<p style="margin:0;">
																							<img border="0" alt="LifeSpace" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/logo.png" />
																							<u></u>
																							<u></u>
																						</p>
																					</td>
																					<td style="text-align:right;vertical-align:middle;padding: 0in 0in 6.0pt 0in;">
																						<span style="font-size: 10.5pt; font-family: Arial,sans-serif; color: #E1E1E1; font-weight: bold;">
																							Dream. Set. Track. Share. Achieve.
																						</span>
																					</td>
																				</tr>
																			</tbody>
																		</table>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
							<tr>
								<td>
									<table width="600" cellspacing="0" cellpadding="0" style="width: 100.0%;">
										<tbody>
											<tr>
												<td>
													<div align="center">
														<table width="600" cellspacing="0" cellpadding="0" border="0" style="width: 6.25in;background:#ffffff;">
															<tbody>
																<tr>
																	<td style="padding: 0.3in 1.0pt 10.0pt 0.2in;">
																		<span style="font-size: 10.5pt; font-family: Arial,sans-serif; color: #6D6E71; font-weight: bold;">
																			<xsl:value-of select="$SenderName"/>
																			has invited you to the following challenge:
																		</span>
																	</td>
																</tr>
																<tr>
																	<td style="padding: 8.0pt 0in 0in 0.2in">
																		<xsl:choose>
																			<xsl:when test="$IsExistingUser = 'True'">
																				<a href="http://{$HostName}/{$PromoteKey}" target="_blank"
																				   style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																					<img src="{$ItemImageURL}" width="45" height="45" align="absmiddle"></img>
																				</a>
																				<a href="http://{$HostName}/{$PromoteKey}" target="_blank"
																				   style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																					<span style="font-size: 11.5pt; font-family: Arial,sans-serif; color: #6D6E73; font-weight: bold;padding: 0in 0in 0in 5.0pt">
																						<xsl:value-of select="$ItemsName"/>
																					</span>
																				</a>
																			</xsl:when>
																			<xsl:otherwise>
																				<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}"
																				   target="_blank" style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																					<img src="{$ItemImageURL}" width="45" height="45" align="absmiddle"></img>
																				</a>

																				<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}"
																				   target="_blank" style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																					<span style="font-size: 11.5pt; font-family: Arial,sans-serif; color: #6D6E73; font-weight: bold;padding: 0in 0in 0in 5.0pt">
																						<xsl:value-of select="$ItemsName"/>
																					</span>
																				</a>
																			</xsl:otherwise>
																		</xsl:choose>





																	</td>
																</tr>
																<tr>
																	<td style="padding: 8.0pt 0in 0in 0.2in">
																		<span style="font-size: 9.5pt; font-family: Arial,sans-serif; color: #5A5A5A; font-weight: bold;">
																			<xsl:value-of select="AjaxRequest/Params/EmailContent" disable-output-escaping ="yes"/>
																		</span>
																	</td>
																</tr>
																<tr>
																	<td style="padding: 15.0pt 1.0pt 5.0pt 0.2in">
																		<table cellspacing="0" cellpadding="0" border="0" style="background:#D2D3D4;">
																			<tbody>
																				<tr>
																					<td style="padding:0in 0in 0in 0in">
																						<p style="line-height:0%;margin:0;">
																							<span style="font-size:1.0pt">
																								<img width="4" height="4" border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/LeftTop_01.png"></img>
																								<u></u>
																								<u></u>
																							</span>
																						</p>
																					</td>
																					<td style="padding:0in 0in 0in 0in"></td>
																					<td style="padding:0in 0in 0in 0in">
																						<p style="line-height:0%;margin:0;">
																							<span style="font-size:1.0pt">
																								<img width="4" height="4" border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/RightTop_01.png"></img>
																								<u></u>
																								<u></u>
																							</span>
																						</p>
																					</td>
																				</tr>
																				<tr>
																					<td style="padding: 0in 0in 0in 0in"></td>
																					<td nowrap="" style="padding:3.75pt 7.5pt 3.75pt 7.5pt">
																						<p style="margin:0;">
																							<span style="font-size: 13.5pt; font-family: Arial,sans-serif; color: #222222; font-weight: normal">
																								<xsl:choose>
																									<xsl:when test="$IsExistingUser = 'True'">
																										<a href="http://{$HostName}/{$PromoteKey}" target="_blank"
																										   style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																											View the Challenge
																										</a>
																									</xsl:when>
																									<xsl:otherwise>
																										<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/{$PromoteKey}"
																										   target="_blank" style="text-decoration:none;font-size: 13.0pt; font-family: Arial,sans-serif; color: #ffffff; font-weight: normal">
																											View the Challenge
																										</a>
																									</xsl:otherwise>
																								</xsl:choose>
																								<u></u>
																								<u></u>
																							</span>
																						</p>
																					</td>
																					<td style="padding:0in 0in 0in 0in"></td>
																				</tr>
																				<tr>
																					<td style="padding:0in 0in 0in 0in">
																						<p style="line-height:0%;margin:0;">
																							<span style="font-size:1.0pt">
																								<img width="4" height="4" border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/LeftBottom_01.png"></img>
																								<u></u>
																								<u></u>
																							</span>
																						</p>
																					</td>
																					<td style="padding:0in 0in 0in 0in"></td>
																					<td style="padding:0in 0in 0in 0in">
																						<p style="line-height:0%;margin:0">
																							<span style="font-size:1.0pt">
																								<img width="4" height="4" border="0" src="https://www.coachsimple.net/desktopModules/LifespaceTemplates/Web/Images/Ver_2_0/RightBottom_01.png"></img>
																								<u></u>
																								<u></u>
																							</span>
																						</p>
																					</td>
																				</tr>
																			</tbody>
																		</table>
																	</td>
																</tr>
															</tbody>
														</table>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</xsl:if>
			<xsl:if test="$Mode = 'Brand' or $Mode = 'BrandSuggestedLinks'">
				<div style="margin-left:10px;margin-top:15px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						Alter My Notification Settings:
						<xsl:choose>
							<xsl:when test="$IsExistingUser = 'True'">
								<a href="http://{$HostName}/Settings.aspx" target="_blank">
									http://<xsl:value-of select="$HostName"/>/Settings.aspx
								</a>
							</xsl:when>
							<xsl:otherwise>
								<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/Settings.aspx" target="_blank">
									http://<xsl:value-of select="$HostName"/>/Settings.aspx
								</a>
							</xsl:otherwise>
						</xsl:choose>
					</span>
				</div>
			</xsl:if>

			<xsl:if test="$Mode != 'Challenge'">
				<div style="margin-left:10px;margin-top:15px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						<xsl:choose>
							<xsl:when test="contains($HostName,'partypongclub') or contains($HostName,'partypong')">
								<xsl:text>Join The Party Pong Club: </xsl:text>
							</xsl:when>
							<xsl:otherwise>
								<span style="font-size: 9.0pt; font-family: Arial,sans-serif; color: #222222; font-weight: bold;">
									Open LifeSpace:
								</span>
							</xsl:otherwise>
						</xsl:choose>
						<xsl:choose>
							<xsl:when test="$IsExistingUser = 'True'">
								<xsl:choose>
									<xsl:when test="contains($HostName,'partypongclub') or contains($HostName,'partypong')">
										<a href="http://{$HostName}/BecomeAMember" target="_blank">
											<xsl:text>http://</xsl:text>
											<xsl:value-of select="$HostName"/>
										</a>
									</xsl:when>
									<xsl:otherwise>
										<a href="http://{$HostName}" target="_blank">
											<xsl:text>http://</xsl:text>
											<xsl:value-of select="$HostName"/>
										</a>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:when>
							<xsl:otherwise>
								<xsl:choose>
									<xsl:when test="contains($HostName,'partypongclub') or contains($HostName,'partypong')">
										<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}/BecomeAMember" target="_blank">
											http://<xsl:value-of select="$HostName"/>
										</a>
									</xsl:when>
									<xsl:otherwise>
										<a href="http://{$HostName}/validateTicket.aspx?ticket={$Ticket}&amp;returnurl=http://{$HostName}" target="_blank">
											http://<xsl:value-of select="$HostName"/>
										</a>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:otherwise>
						</xsl:choose>
					</span>
				</div>
				<xsl:if test="$Mode = 'club'">
					<div style="margin-left:10px;margin-top:20px;">
						You have been invited to join the Party Pong Club where you can participate in
						<span style="color:red;font-weight:bold;">FREE</span> Party Pong Tournaments and earn points based on your tournament placement, then redeem those points online for 1,000s of prizes!
					</div>
				</xsl:if>
				<div style="margin-left:10px;margin-top:20px;">
					<span align="left" style="font-family: Calibri, Verdana, Arial;font-size: 10pt;">
						*** Please do not reply to this automated message ***
					</span>
				</div>
			</xsl:if>
		</div>
	</xsl:template>
</xsl:stylesheet>
