Running into a weird issue with the site build I'm working currently:
We're creating users based on email addresses coming from an event platform API and are sending activation emails to those users (from our plugin,
using craft()->users->sendActivationEmail($user)
).
The email gets sent out but the activation {{link}}
is missing the host part of the URL. Instead we're seeing links like this: http:/actions/users/setpassword?code=bo2EDjfC7ebsrEpsx5T%7EyJ2Q6TRR0bI6&id=912b5712-89f6-4dbc-9337-dec15b518536
.
Add the host in between and the link works perfectly. I've tried setting a {{ siteUrl }}
specifically the locale I'm in but that doesn't do the trick either.
When I go to the new user in the back-end and copy the activation URL there, that one is correct.
Any pointers as to what might be causing this? Thanks!
UPDATE
This is the craft/config/general.php
we're using:
<?php
if (!defined('PROJECTCODE')) {
define('PROJECTCODE', strtolower('seapla'));
}
if (!defined('ENV')) {
switch (strtolower($_SERVER['DOCUMENT_ROOT'])) {
case '/data/sites/web/'.PROJECTCODE.'/subsites/'.PROJECTCODE.'.live.be/public';
define('ENV', 'live');
break;
case '/data/sites/web/'.PROJECTCODE.'/subsites/'.PROJECTCODE.'.staging.be/public';
define('ENV', 'staging');
break;
default:
define('ENV', 'local');
break;
}
}
$settings = [
'subscriptionPrice' => 275,
'subscriptionPeriod' => 'P1Y',
'invoicePrefix' => 'ECF2017',
'autoLoginAfterAccountActivation' => true,
'useEmailAsUsername' => true,
'setPasswordPath' => '_members/_reset',
'logoutPath'=> 'e-learning',
'defaultCpLanguage' => 'en_be',
'defaultWeekStartDay' => 1,
'logoutPath' => 'logout',
'enableCsrfProtection' => true,
'omitScriptNameInUrls' => true,
'postCpLoginRedirect' => 'entries',
'addTrailingSlashesToUrls' => false,
'defaultSearchTermOptions' => array(
'subLeft' => true,
'subRight' => true,
),
'environmentVariables' => [
'basePath' => getcwd(),
'baseUrl' => strtolower((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://') . $_SERVER['SERVER_NAME']),
],
'siteUrl' => strtolower((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://' : 'http://') . $_SERVER['SERVER_NAME']),
];
switch (ENV) {
case 'live':
$settings['devMode'] = false;
$settings['cache'] = true;
break;
case 'staging':
$settings['devMode'] = true;
$settings['cache'] = false;
break;
default:
$settings['devMode'] = true;
$settings['cache'] = false;
break;
}
return $settings;
.htaccess
rewrite rule interfering with that request? Can you edit the question to share yourcraft/config/general.php
file?