Bugfix in mail output and cleanup.
This commit is contained in:
parent
dce1783dfe
commit
0ce5d7cd42
@ -70,7 +70,7 @@ if (!$tpl_done && isset($_SESSION['access_token']) && $_SESSION['access_token'])
|
|||||||
$client->setAccessToken($_SESSION['access_token']);
|
$client->setAccessToken($_SESSION['access_token']);
|
||||||
if ($client->isAccessTokenExpired()) {
|
if ($client->isAccessTokenExpired()) {
|
||||||
// TODO: Redirect to $client->createAuthUrl(); to reauthenticate
|
// TODO: Redirect to $client->createAuthUrl(); to reauthenticate
|
||||||
echo "Token expired! <a href=\"" . $client->createAuthUrl() . "\">Request new one</a>.";
|
echo 'Token expired! <a href="' . $client->createAuthUrl() . '">Request new one</a>.';
|
||||||
#session_destroy();
|
#session_destroy();
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ if (!$tpl_done && isset($_SESSION['access_token']) && $_SESSION['access_token'])
|
|||||||
} else {
|
} else {
|
||||||
switch ($_GET['action']) {
|
switch ($_GET['action']) {
|
||||||
case 'send':
|
case 'send':
|
||||||
echo "This would send the mail...";
|
echo 'This would send the mail...';
|
||||||
$mo = new MailOutput(dirname(__FILE__) . '/templates');
|
$mo = new MailOutput(dirname(__FILE__) . '/templates');
|
||||||
$mo->setTemplate('mail_' . $form_type);
|
$mo->setTemplate('mail_' . $form_type);
|
||||||
$action = $form_type;
|
$action = $form_type;
|
||||||
@ -112,7 +112,7 @@ if (!$tpl_done && isset($_SESSION['access_token']) && $_SESSION['access_token'])
|
|||||||
|
|
||||||
$data['email_date'] = date('r');
|
$data['email_date'] = date('r');
|
||||||
$data = array_merge($data, $fields);
|
$data = array_merge($data, $fields);
|
||||||
$mo->setTemplateVars($data);
|
$mo->addTemplateVars($data);
|
||||||
|
|
||||||
$mail_html = $mo->getRenderedOutput();
|
$mail_html = $mo->getRenderedOutput();
|
||||||
list($headers, $mailbody) = preg_split('/\r?\n\r?\n/', $mail_html, 2);
|
list($headers, $mailbody) = preg_split('/\r?\n\r?\n/', $mail_html, 2);
|
||||||
|
Reference in New Issue
Block a user