[英]Email send not clickable url after registration PHP
我的問題是用戶注冊后發送的電子郵件。 當您收到用於帳戶驗證的電子郵件時,您需要使用瀏覽器訪問一個鏈接來驗證帳戶。
該鏈接不可點擊 ,您必須將其復制並粘貼到瀏覽器中。 但是我需要使其可點擊。 我在我的php文件中找到了鏈接的來源。
電子郵件驗證中鏈接的源代碼
'.get_bloginfo('url').'/?ekey='.$emailhash;
整個來源是
$body = _d('Hello',17).' '.$yourname.'<br /><br />
'._d('Before you can use the site you will need to validate your email address.',795).'
'._d('If you don\'t validate your email in the next 3 days your account will be deleted.',960).'<br /><br />
'._d('Please validate your email address by clicking the link bellow',1025).': </br>
<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>
escort_email("", "", $youremail, _d('Email validation link',1026)." ".get_option("email_sitename"), $body);
有什么辦法可以使它作為href標簽或類似的東西可點擊?
謝謝。
HTML錨點看起來像這樣
<a href="http://www.example.com">some link</a>
您將需要在要顯示的鏈接上串聯。
get_bloginfo('url') . '/?ekey=' . $emailhash
以便替換上面的“ example.com”鏈接。
你可以這樣
<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>
編輯:嘗試此代碼:
響應opies更新的代碼...您的錨標簽已經在php標簽內回顯了,所以這樣的解決方案:
<?php
<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>
?>
將失敗,因為我們不能嵌套<?php ?>
標記。
解決方案是將所需的值簡單地串聯到html中,如下所示:
$body = _d('Hello', 17) . ' ' . $yourname . '
<br />
<br />
' . _d('Before you can use the site you will need to validate your email address.',795) . '
' . _d('If you don\'t validate your email in the next 3 days your account will be deleted.',960).'<br /><br />
' . _d('Please validate your email address by clicking the link bellow',1025). ':
</br>
<a href="' . get_bloginfo('url') . '/?ekey=' . $emailhash . '">some link</a>';
escort_email("", "", $youremail, _d('Email validation link',1026)." ".get_option("email_sitename"), $body);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.