Ejemplo n.º 1
0
 public static function sendRecover($email)
 {
     User::validateExistingEmail($email, UserFetcher::DB_TABLE);
     $user = UserFetcher::retrieveUsingEmail($email);
     if ($user[UserFetcher::DB_COLUMN_ACTIVE] != 1) {
         throw new Exception("Sorry, you account has been de-activated.");
     }
     $userId = $user[UserFetcher::DB_COLUMN_ID];
     $receiverName = $user[UserFetcher::DB_COLUMN_FIRST_NAME] . " " . $user[UserFetcher::DB_COLUMN_LAST_NAME];
     $genString = User::generateNewPasswordString($userId);
     # First, instantiate the SDK with your API credentials and define your domain.
     $mg = new Mailgun(App::getMailgunKey());
     $domain = App::getMailgunDomain();
     // Load mail template
     $emailVerificationTemplate = file_get_contents(ROOT_PATH . 'mail/templates/verify_recovery.html');
     $verifyAccountRecoveryLink = App::getDomainName() . "/login/set/" . $userId . "/" . $genString;
     try {
         # Now, compose and send the message.
         $mg->sendMessage($domain, ['from' => "SASS App admin@" . App::getHostname(), 'to' => $email, 'subject' => 'SASS Account Recovery', 'text' => 'Your mail does not support html', 'html' => $emailVerificationTemplate, 'recipient-variables' => '{"' . $email . '": {"id":' . $userId . ',"verifyAccountRecoveryLink":"' . $verifyAccountRecoveryLink . '","fullName":"' . $receiverName . '"}}']);
     } catch (Exception $e) {
         throw new Exception("Sorry, we could not send your recovery email. Please contact the secretariat at your earliest\n\t\t\tconvenience or submit a bug issue <a href='" . App::getGithubNewIssueUrl() . "' target='_blank'>here</a>.");
     }
 }
Ejemplo n.º 2
0
		};
		var pnotifySettingsWarning = {
			title        : 'Tutor Warning',
			text         : '',
			type         : 'error',
			delay        : 7000,
			history      : {history: true, menu: true},
			addclass     : "stack-bottomright", // This is one of the included default classes.
			stack        : stack_bottomright,
			animation    : "slide",
			animate_speed: "slow"
		};
		pnotifySettingsInfo.text = "Please notice tutors daily receive one email if they have any pending appointments/reports. This email contain " +
		"links to their corresponding pending appointments & reports to be filled.<br/> If you had pending " +
		"appointments/reports and didn't receive your email please contact the secretariat or submit a <a href='<?php 
echo App::getGithubNewIssueUrl();
?>
'>new issue</a>." ;
		new PNotify(pnotifySettingsInfo);
		$('.changeWeek').on('click', function ()
		{
			var $a = $(this);
			var $form = $a.next();
			$form.submit();
		});

		if (!$('#workshop-chart').length)
		{
			return false;
		}
		if (!$('#area-chart-appointments').length)