<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
		<title>TRREB Unsubscribe Page</title>
		
		<meta charset="UTF-8">
		<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
		<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
		<meta HTTP-EQUIV="Expires" CONTENT="-1">
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		
		
		<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,700italic,700" rel="stylesheet" type="text/css" />		
		<link rel="shortcut icon"  href="/images/favicon.ico">		
		<!-- Common styles and scripts -->
		<link rel=stylesheet type="text/css" href="/css/global.css">
		<link rel="stylesheet" href="/webjars/font-awesome/5.15.4/css/all.css"/>		
		<link rel="stylesheet" href="/webjars/bootstrap/5.1.0/css/bootstrap.min.css" />			
		<script type="text/javascript" src="/webjars/bootstrap/5.1.0/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="/webjars/popper.js/2.9.3/umd/popper.min.js"></script>
		<script type="text/javascript" src="/webjars/jquery/3.6.0/jquery.min.js"></script>
		<script type="text/javascript" src="/js/treb-common.js"></script>	
			
		
		
		
		
		<script>	
			
			function getCurrentYearYYYYZ() {
				var currentDate = new Date();	
				return currentDate.getFullYear();
			}
			
			$(document).ready(function() {
				$("#cright").html(getCurrentYearYYYYZ());
			});			
		</script>	
	</head>


<body class="body"
	style="padding:0 !important; margin:0 !important; display:block !important; min-width:100% !important; width:100% !important; background:#e9e8e2; -webkit-text-size-adjust:none">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#e9e8e2">
		<tr>
			<td align="center" valign="top">
				<table width="650" border="0" cellspacing="0" cellpadding="0" class="mobile-shell">
					<tr>
						<td class="td"
							style="width:650px; min-width:650px; font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;">

							<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer"
					style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
					<tr>
						<td height="30" class="spacer"
							style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
							&nbsp;</td>
					</tr>
				</table>


				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td>

							<table width="100%" border="0" cellspacing="0" cellpadding="0"
								bgcolor="#ffffff">
								<tr>
									<td valign="top">
										<div
											style="font-size:0pt; line-height:0pt; height:4px; background:#0071bb; width: 100%;">
											<img src="https://trreb.ca/ListManager/images/spacer.gif"
												width="1" height="4" style="height:4px"
												alt="" />
										</div>
									</td>
								</tr>
							</table>


							<table width="100%" border="0" cellspacing="0" cellpadding="0"
								bgcolor="#ffffff">
								<tr>
									<td class="content-spacing"
										style="font-size:0pt; line-height:0pt; text-align:left"
										width="30"></td>
									<td>
										<table width="100%" border="0" cellspacing="0"
											cellpadding="0" class="spacer"
											style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											<tr>
												<td height="16" class="spacer"
													style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
													&nbsp;</td>
											</tr>
										</table>

										<table width="100%" border="0" cellspacing="0"
											cellpadding="0">
											<tr>

												<th class="column"
													style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;"
													width="202" valign="top">
													<table width="100%" border="0"
														cellspacing="0" cellpadding="0">
														<tr>
															<td class="img"
																style="font-size:0pt; line-height:0pt; text-align:left">


																<div class="img-m-center"
																	style="font-size:0pt; line-height:0pt; text-align:left">
																	<a href="https://trreb.ca"
																		target="_blank"><img
																			src="https://trreb.ca/ListManager/images/TREB_Dots_Azure-Blue.svg"
																			border="0"
																			width="70"
																			height="81"
																			alt="" /></a>
																</div>
																<!-- END Logo -->

																<div style="font-size:0pt; line-height:0pt;"
																	class="mobile-br-20"></div>

															</td>
														</tr>
													</table>
												</th>

												<th class="column"
													style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;"
													valign="top">
													<table width="100%" border="0"
														cellspacing="0" cellpadding="0">
														<tr>
															<td align="right">

																<table width="100%" border="0"
																	cellspacing="0"
																	cellpadding="0">
																	<tr>
																		<td class="img"
																			style="font-size:0pt; line-height:0pt; text-align:left">


																			<div class="img-m-center"
																				style="font-size:0pt; line-height:0pt; text-align:right">
																				<a href="https://trreb.ca"
																					target="_blank"><img
																						src="https://trreb.ca/ListManager/images/email_icon.png"
																						border="0"
																						width="74"
																						height="81"
																						alt="" /></a>
																			</div>
																			<!-- END Logo -->

																			<div style="font-size:0pt; line-height:0pt;"
																				class="mobile-br-20">
																			</div>

																		</td>
																	</tr>
																</table>

															</td>
														</tr>
													</table>
												</th>

											</tr>
										</table>
										<table width="100%" border="0" cellspacing="0"
											cellpadding="0" class="spacer"
											style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											<tr>
												<td height="15" class="spacer"
													style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
													&nbsp;</td>
											</tr>
										</table>

									</td>
									<td class="content-spacing"
										style="font-size:0pt; line-height:0pt; text-align:center"
										width="30"></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>

			</td>
		</tr>
	</table>

							<!-- Main Article-->
							<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td>
													<div>
														<table width="100%" border="0" cellspacing="0" cellpadding="0">
															<tr>
																<td class="content-spacing" width="30"></td>
																<td>
																	<div style="font-size:0pt; line-height:0pt;" class="mobile-br-15"></div>

																	<table width="100%" border="0" cellspacing="0" cellpadding="0">
																		<tr>
																			<td align="center">

																			</td>
																		</tr>
																	</table>
																	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">

																	</table>

																	<div style="font-size:0pt; line-height:0pt;" class="mobile-br-15"></div>
																</td>
																<td class="content-spacing" style="font-size:0pt; line-height:0pt; text-align:center;" width="30"></td>
															</tr>
														</table>
													</div>

												</td>
											</tr>
										</table>
										<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											<tr>
												<td height="17" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
													&nbsp;
												</td>
											</tr>
										</table>


										<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											<tr>
												<td height="12" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
													&nbsp;
												</td>
											</tr>
										</table>
										<!-- END Main Article -->


										<!-- Features -->
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td class="content-spacing" style="font-size:0pt; line-height:0pt; text-align:left" width="60">
												</td>
												<td>
													<div class="hide-for-mobile">
														<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
															<tr>
																<td height="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																	&nbsp;
																</td>
															</tr>
														</table>

													</div>

													<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
														<tr>
															<td class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																&nbsp;
															</td>
														</tr>
														<tr>
															<td height="12" class="spacer"
																style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
															</td>
														</tr>
													</table>

													<!-- Article On The Right -->
													<table width="100%" border="0" cellspacing="0" cellpadding="0" dir="rtl" bgcolor="#ffffff" style="direction:rtl !important;">
														<tr>
															<th class="column" style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;" width="34" valign="top" dir="ltr">
																<table width="100%" border="0" cellspacing="0" cellpadding="0" style="direction:ltr !important;">
																	<tr>
																		<td>
																			<div style="font-size:0pt; line-height:0pt;"
																				class="mobile-br-25"></div>
																		</td>
																	</tr>
																</table>
															</th>

															<th class="column" style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;" valign="top" dir="ltr">
																<table width="100%" border="0" cellspacing="0" cellpadding="0" style="direction:ltr !important;">
																	<tr>
																		<td>
																			<div class="h4" style="color:#0071bb; font-family:Arial,sans-serif, 'SSP'; font-size:24px; line-height:24px; text-align:left; font-weight: 700;">
																				<span class="span-subscribe-text">Unsubscribe From</span> TRREB&rsquo;s Email List
																			</div>
																			
																			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																				<tr>
																					<td height="15" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																						&nbsp;</td>
																				</tr>
																			</table>

																			<div class="text" style="color:#262b37; font-family:Arial,sans-serif, 'SSP'; font-size:14px; line-height:24px; text-align:left">
																				<p>&nbsp;</p>
																				<p>Enter your TRREB membership number:
																				  <label for="number"></label>
																				  <input type="password" name="memberId" id="memberId">
																				</p>																				
																				<p>&nbsp;</p>
																				<p>&nbsp;</p>
																		    </div>
																			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																				<tr>
																					<td height="16" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																						&nbsp;
																					</td>
																				</tr>
																			</table>
																			<!-- Button -->
																				
																			<table width="100%" border="0" cellspacing="0" cellpadding="0">
																				<tr>
																					<td align="center">
																						<table class="link-blue" border="0" cellspacing="0" cellpadding="0" bgcolor="#0071bb" style="border-radius: 24px;">
																							<tr>
																								<td class="content-spacing" style="font-size:0pt; line-height:0pt; text-align:center" width="25" height="35">
																								</td>
																								<td>
																									<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																										<tr>
																											<td height="5" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																												&nbsp;
																											</td>
																										</tr>
																									</table>

																									<div id="btn-unsubscribe" class="text-button1" style="cursor:pointer; color:#ffffff; font-family:Arial,sans-serif, 'SSP'; font-size:12px; line-height:16px; text-align:center; text-transform:uppercase">
																										<span class="link-white span-subscribe-btn" style="color:#ffffff; text-decoration:none">Unsubscribe</span>
																									</div>
																									
																									<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																										<tr>
																											<td height="5" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																												&nbsp;
																											</td>
																										</tr>
																									</table>
																								</td>
																								<td class="content-spacing" style="font-size:0pt; line-height:0pt; text-align:center" width="25"></td>
																							</tr>
																						</table>
																					</td>
																				</tr>
																			</table>

																			<!-- END Button -->
																			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																				<tr>
																					<td height="16" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																						&nbsp;
																					</td>
																				</tr>
																			</table>

																		</td>
																	</tr>
																</table>
															</th>

														</tr>

													</table>

													<!-- END Article Image On The Right -->


													<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
														<tr>
															<td height="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																&nbsp;
															</td>
														</tr>
													</table>

													<table width="100%" border="0" cellspacing="0" cellpadding="0" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
														<tr>
															<td height="20" class="spacer" style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																&nbsp;
															</td>
														</tr>
													</table>

												</td>

												<td class="content-spacing" style="font-size:0pt; line-height:0pt; text-align:left" width="30">
												</td>
											</tr>
										</table>
										<!-- END Other Issue Features -->
																				
										<!--Footer-->
										<div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#262b37" >
			<tr>
				<td>
					<!-- Footer Inner -->
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td class="content-spacing"
								style="font-size:0pt; line-height:0pt; text-align:left"
								width="30"></td>
							<td>
								<table width="100%" border="0" cellspacing="0"
									cellpadding="0" class="spacer"
									style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
									<tr>
										<td height="30" class="spacer"
											style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											&nbsp;</td>
									</tr>
								</table>
	
								<table width="100%" border="0" cellspacing="0"
									cellpadding="0">
									<tr>
	
										<th class="column"
											style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;"
											width="276" valign="top">
											<table width="100%" border="0"
												cellspacing="0" cellpadding="0">
												<tr>
													<td class="img"
														style="font-size:0pt; line-height:0pt; text-align:left">
	
														<div class="img-m-center"
															style="font-size:0pt; line-height:0pt; text-align:center">
															<a href="https://trreb.ca"
																target="_blank"><img
																	src="https://trreb.ca/ListManager/images/TREB_Full_Tagline-White.svg"
																	border="0"
																	width="200"
																	height="81"
																	alt="" /></a>
														</div>
	
														<table width="100%" border="0"
															cellspacing="0"
															cellpadding="0"
															class="spacer"
															style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
															<tr>
																<td height="20"
																	class="spacer"
																	style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																	&nbsp;</td>
															</tr>
														</table>
	
													</td>
												</tr>
											</table>
										</th>
	
									</tr>
								</table>
								<table width="100%" border="0" cellspacing="0"
									cellpadding="0">
									<tr>
	
										<th class="column"
											style="font-size:0pt; line-height:0pt; padding:0; margin:0; font-weight:normal;"
											width="276" valign="top">
											<table width="100%" border="0"
												cellspacing="0" cellpadding="0">
												<tr>
													<td>
														<!-- Footer Copyright -->
														<div class="text-footer"
															style="color:#ffffff; font-family:Arial,sans-serif, 'SSP'; font-size:12px; line-height:18px; text-align:center; font-weight: 300;">
															<p><strong>Note</strong>:
																Although TRREB
																endeavours to ensure the
																accuracy and timeliness
																of information, it is
																not guaranteed. TRREB
																accepts no
																responsibility for any
																loss arising from any
																use or reliance on the
																information contained
																herein.</p><br />
														</div>
														<!-- END Footer Copyright -->
														<table width="100%" border="0"
															cellspacing="0"
															cellpadding="0"
															class="spacer"
															style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
															<tr>
																<td height="10"
																	class="spacer"
																	style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
																	&nbsp;</td>
															</tr>
														</table>
	
													</td>
												</tr>
											</table>
										</th>
	
									</tr>
								</table>
	
	
							</td>
							<td class="content-spacing"
								style="font-size:0pt; line-height:0pt; text-align:left"
								width="30"></td>
						</tr>
					</table>
					<!-- END Footer Inner -->
					<table width="100%" border="0" cellspacing="0" cellpadding="0"
						bgcolor="#111111">
						<tr>
							<td class="content-spacing"
								style="font-size:0pt; line-height:0pt; text-align:left"
								width="30"></td>
							<td>
								<table width="100%" border="0" cellspacing="0"
									cellpadding="0" class="spacer"
									style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
									<tr>
										<td height="25" class="spacer"
											style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											&nbsp;</td>
									</tr>
								</table>
	
								<!-- Footer Social Media -->
								<div class="text-footer-c"
									style="color:#a0a09a; font-family:Arial,sans-serif, 'SSP'; font-size:12px; line-height:18px; text-align:center">
	
									<p> All information on this site is copyright&copy;
										Toronto Regional Real Estate Board. All rights
										reserved.</p>
									<br>
	
	
									<a href="https://www.facebook.com/TRREB/"><img
											src="https://www.trreb.ca/ListManager/images/facebook.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a href="https://twitter.com/TheReal_TRREB"><img
											src="https://www.trreb.ca/ListManager/images/twitter.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a href="https://www.linkedin.com/company/toronto-regional-real-estate-board/"><img
											src="https://www.trreb.ca/ListManager/images/linkedin.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a href="https://www.instagram.com/thereal_trreb/"><img
											src="https://www.trreb.ca/ListManager/images/instagram.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a href="https://www.trrebwire.ca/"><img
											src="https://www.trreb.ca/ListManager/images/wordpress.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a
										href="https://www.youtube.com/TorontoRegionalRealEstateBoard"><img
											src="https://www.trreb.ca/ListManager/images/youtube.png"
											class="sm" alt="" /></a>&nbsp;
	
									<a href="https://www.readytorealestate.podbean.com"><img
											src="https://www.trreb.ca/ListManager/images/podbean.png"
											class="sm" alt="" /></a>
	
								</div>
								<!-- END Footer Social Media -->
								<table width="100%" border="0" cellspacing="0"
									cellpadding="0" class="spacer"
									style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
									<tr>
										<td height="25" class="spacer"
											style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
											&nbsp;</td>
									</tr>
								</table>
	
							</td>
							<td class="content-spacing"
								style="font-size:0pt; line-height:0pt; text-align:left"
								width="30"></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<div class="hide-for-mobile">
			<table width="100%" border="0" cellspacing="0" cellpadding="0"
				bgcolor="#111111" class="spacer"
				style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
				<tr>
					<td height="30" class="spacer"
						style="font-size:0pt; line-height:0pt; text-align:center; width:100%; min-width:100%">
						&nbsp;</td>
				</tr>
			</table>
		</div>
	</div>										
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
<script>

	var encryptedStr = "sitemap.xml";
	var subscritpionType = 0; //0: unsubscribe, 1:subscribe;

	$(document).ready(function () {
		/*
		$(window).on('pageshow', function () {
			location.reload();
		});
		*/

		isValidEmail(encryptedStr);	
		
		$("#memberId").on('keyup', function (e) {
		    if (e.key === 'Enter' || e.keyCode === 13) {
		        $("#btn-unsubscribe").trigger("click");
		    }
		});		

		$("#btn-unsubscribe").click(function () {

			var memberId = $.trim($("#memberId").val());

			if (memberId == '') {
				$.showMsgDialog({
					type: 'error',
					title: "Missing MemberID",
					message: "TRREB membership number must be entered. ",
					close: "Close",
					function_close: function () {
					}
				});
			} else {
				
				var subscribeURL = "\/api\/unsubscribe";
				
				if(subscritpionType == 0) {
					subscribeURL = "\/api\/subscribe";
				}
				
				$.ajax({
					url:"\/api\/validate\/member",
					type: 'post',
					dataType: 'json',
					data: {
						encryptedStr: encryptedStr,
						memberId: memberId,
					},
					success: function (data) {
						var email = data.email;
						var isValid = data.isValid;

						if (isValid) {							
							var nextURL = "/unsubscribe";							
							if(subscritpionType == 1) {
								nextURL = "/subscribe";
							}
							
							$.trebAddForm({
								formName: "subscribeForm",
								method: "post",
								action: nextURL,
								inputs: [{
									name: "email",
									value: email
								}, {
									name: "encryptedStr",
									value: encryptedStr
								}, {
									name: "memberId",
									value: memberId
								}]
							});

							$("#subscribeForm").submit();
							$("#subscribeForm").remove();
						} else {
							$.showMsgDialog({
								type: 'error',
								title: "Unmatched Member Information",
								message: "Your TRREB membership number entered and Email Address is not matched. Please retry it again after verifying your Membership Number.",
								close: "Close",
								function_close: function () {
								}
							});
						}
					},
					error: function (data) {
						$.showMsgDialog({
							type: 'error',
							title: "Internal Server Error",
							message: "Your request can not be processed as entered. Try again later ",
							close: "Close",
							function_close: function () {

							}
						});
					}
				});
			}
		});

	});

	function isValidEmail(encryptedStr) {
		$.ajax({
			url:"\/api\/validate",
			type: 'post',
			dataType: 'json',
			data: {
				encryptedStr: encryptedStr,
			},
			success: function (data) {
				console.log(data);
				if (!data.isValidEmail) {
					$.showMsgDialog({
						type: 'error',
						title: "Unavailable URL",
						message: "Your request can not be processed as entered. Try again later ",
						close: "Close",
						function_close: function () {
							$("#spinner").addClass("show");
							location.href = "https://www.trreb.ca";
						}
					});
				} else {
					if(!data.isUnsubscribed) {
						$(".span-subscribe-text").html("Unsubscribe From");
						$(".span-subscribe-btn").html("Unsubscribe");
						
						subscritpionType = 0;
					} else {
						$(".span-subscribe-text").html("Subscribe to");
						$(".span-subscribe-btn").html("Subscribe");
						subscritpionType = 1;
					}
				}

			},
			error: function (data) {
				$.showMsgDialog({
					type: 'error',
					title: "Internal Server Error",
					message: "Your request can not be processed as entered. Try again later ",
					close: "Close",
					function_close: function () {

					}
				});
			}
		});
	}
</script>


</html>