0

从 PHP 发送时,我的 HTML 有一个奇怪的问题。超链接没有按应有的方式显示。这是它在我的电子邮件客户端上呈现的方式:

链接到图片

如您所见,有 2 个变量将字符串发送到电子邮件正文:

    $texto_msg = 'HOLA <a href="http://vendoan.com">ANCHOR</a>';
    $url_anuncio = 'Sal bien!!: <a href="'.get_permalink($post_tmp).'">Título: '.get_the_title($post_tmp).'</a>';


    $e_subject = __('Alguien se ha interesado por tu anuncio en VendoAndroid','jigowatt');

    // Advanced Configuration Option.
    // You can change this if you feel that you need to.
    // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here.

    $msg  = __('¡Hola! Un usuario de VendoAndroid se ha interesado en tu anuncio:'). PHP_EOL . PHP_EOL;
    //$msg .= __('<a href="'.get_permalink($post_tmp).'">Título: '.get_the_title($post_tmp).'</a>') . PHP_EOL . PHP_EOL;
    $msg .= __($texto_msg) . PHP_EOL;
    $msg .= __($url_anuncio) . PHP_EOL;
    $msg .= implode(PHP_EOL, $comments) . PHP_EOL . PHP_EOL;
    $msg .= "-------------------------------------------------------------------------------------------\r\n";
    $msg .= 'Mensaje enviado desde <a href="http://vendoandroid.com" ><strong>VendoAndroid.com</strong></a>';

    $msg = wordwrap( $msg, 70 );

我不明白为什么第一个链接效果很好,而不是第二个。

有任何想法吗?

谢谢

更新:

@Joachim Isaksson,这是原始来源:

<p>¡Hola! Un usuario de VendoAndroid se ha interesado en tu anuncio:</p>
<p>Título: <strong>Puto Firefox jodio</strong><br />
<a href="http://vendoandroid.com/mis-anuncios/"><strong>área de<br />
usuario.</strong></a><br />
Puedes ver, editar o eliminar tu anuncios accediendo a tu <a<br />
href="http://vendoandroid.com/mis-anuncios/"><strong>área de<br />
usuario.</strong></a><br />
4

2 回答 2

0

如果在翻译表中找到一个,__($text) 函数可能会返回翻译后的 $text。使用 HTML 和原始文本时不应混合使用它。

尝试 :

$url_anuncio = __("Sal bien!!:").' <a href="'.get_permalink($post_tmp).'"> '.__("Título: ").get_the_title($post_tmp)."</a>";

进而 :

$msg .= $url_anuncio . PHP_EOL;
于 2013-01-12T19:10:28.310 回答
0

我的错。Wordpress 核心存在某种问题。

http://codex.wordpress.org/Function_Reference/make_clickable

现在正在尝试修复它。谢谢

于 2013-01-13T13:15:21.007 回答