DO $$
	BEGIN
		IF EXISTS (SELECT "Id" FROM public."Versions" WHERE "Build">=3124) THEN
			RETURN;
	END IF;

	BEGIN

		UPDATE public."MessageSettings" SET "Value" = N'<html><head></head>
<body style="padding:0;Margin:0">
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tbody>
			<tr>
				<td align="center" bgcolor="#F8F8F8" width="100%">
					<table cellpadding="0" cellspacing="0" width="100%" border="0">
						<tbody>
							<tr>
								<td align="center">
									<table align="center" cellpadding="0" cellspacing="0" border="0" style="max-width:900px; min-width:320px; width:90%">
										<tbody>
											<tr>
												<td align="left">
													<table align="center" cellpadding="0" cellspacing="0" border="0" width="90%">
														<tbody>
															<tr>
																<td align="left">
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="20"></td>
																			</tr>
																		</tbody>
																	</table><img src="{{logo}}" border="0" style="display:block; max-width:250px; max-height: 35px; ">
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="20"></td>
																			</tr>
																		</tbody>
																	</table>
																</td>
															</tr>
														</tbody>
													</table>
												</td>
											</tr>
											<tr>
												<td align="left" bgcolor="#FFFFFF" style="border-radius:24px">
													<table align="center" cellpadding="0" cellspacing="0" border="0" width="90%">
														<tbody id="container">
															<tr>
																<td align="left">
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="30"></td>
																			</tr>
																		</tbody>
																	</table>
																	<div style="font-family:-apple-system,''Segoe UI'',''Helvetica Neue'',Helvetica,Roboto,Arial,sans-serif; font-size:22px; line-height:30px; color:#333333">
																		<strong>Подписка на «Р7-Пространство» активирована.</strong>
																	</div>
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="10"></td>
																			</tr>
																		</tbody>
																	</table>
																	<div style="font-family:-apple-system,''Segoe UI'',''Helvetica Neue'',Helvetica,Roboto,Arial,sans-serif; font-size:16px; line-height:30px; color:#333333">
																		Если вам требуются инструкции по настройке или использованию Р7-Пространства, посетите наш&nbsp;
																		<a href="https://support.r7-office.ru/hc/ru/" target="_blank">Справочный центр</a>
																		.
																	</div>
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="30"></td>
																			</tr>
																		</tbody>
																	</table>
																	
																	<table cellpadding="0" cellspacing="0" border="0" width="100%">
																		<tbody>
																			<tr>
																				<td height="30"></td>
																			</tr>
																		</tbody>
																	</table>

																</td>
															</tr>
														</tbody>
													</table>
												</td>
											</tr>
										</tbody>
									</table>
									<table cellpadding="0" cellspacing="0" border="0" width="100%">
										<tbody>
											<tr>
												<td height="40"></td>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
		</tbody>
	</table>
</body></html>'
		WHERE "Key" = 'Notification.Html.ActivationLicense';

		UPDATE public."MessageSettings" SET "Value" = 'Активация подписки на Р7-Пространство' WHERE "Key" = 'Notification.Subject.ActivationLicense';

		EXCEPTION
			WHEN OTHERS THEN RAISE NOTICE 'Add contacts application error.';
		END;
	END;
$$