tenants
Well-known member
Hi, I'm creating a mod that sends a user an email
Within this email, a url is sent:
The text is hard coded while I test it, they will be turned into phrases
The question I have is that I wondered if anyone has managed to pass a URL as a link within an email using a similar method to the above. Right now, I'm finding the email message comes out as:
If this was you, you can log-in using this temporary link:
<a href='http:// someforum.co.uk/login/?key=24ca533bd47350925f5a6bac48ed9054d8f6d01abf7979a84'>http:// someforum.co.uk/login/?key=24ca533bd47350925f5a6bac48ed9054d8f6d01abf7979a84</a>
It's not essential to have an active link, but it would be nice
Within this email, a url is sent:
PHP:
public function sendLoginKeyEmail(array $user, $key)
{
$link = XenForo_Link::buildPublicLink('full:login', $key, array('key' => $key));
$mailParams = array(
'user' => $user,
'subject' => "login_security_link",
'boardTitle' => XenForo_Application::get('options')->boardTitle,
'message' =>
"Some one has tried to log in to your account from an ip address not associated to your Login Security \n".
"Sent from IP Address: \n".
"If this was you, you can log-in using this temporary link: \n".
"<a href='".$link."'>".$link."</a>"
);
$mail = XenForo_Mail::create('contact', $mailParams, 0);
$mail->send(
$user['email'], // $toEmail
$user['username'], // $toName
array(
'Sender' => XenForo_Application::get('options')->contactEmailAddress // $headers
),
XenForo_Application::get('options')->contactEmailAddress, // $fromEmail
XenForo_Application::get('options')->boardTitle, // $fromName
XenForo_Application::get('options')->contactEmailAddress // $returnPath
);
The text is hard coded while I test it, they will be turned into phrases
The question I have is that I wondered if anyone has managed to pass a URL as a link within an email using a similar method to the above. Right now, I'm finding the email message comes out as:
If this was you, you can log-in using this temporary link:
<a href='http:// someforum.co.uk/login/?key=24ca533bd47350925f5a6bac48ed9054d8f6d01abf7979a84'>http:// someforum.co.uk/login/?key=24ca533bd47350925f5a6bac48ed9054d8f6d01abf7979a84</a>
It's not essential to have an active link, but it would be nice