Soluciona el envío de email de activación en Buddypress

contacta     ·     sobre     ·     azar     ·     buchaca     ·     manifiestos    ·   

  • Forma

    La intención, la mirada, la propuesta. Dónde yace lo que parece haber cuajado en un proceso de meditación-acción.

Porque si te abres una cuenta en una red social es importante que certifiques que el email es tuyo, también lo es poder recibir ese email para validarla. Aquí un truco para que no te falle Buddypress.
Una cosa horrible que pasa cuando usas el querido Buddypress es que el envío de email de activación no acaba de funcionar bien del todo. Navegando por los mares de bits encontré este truco que apunté en un post-it y ahora no recuerdo de quién era, pero mío no ¡eso seguro!

Con hacer lo que sigue a mi me ha funcionado bastante bien hasta ahora:

En buddypress/bp-core/bp-core-functions.php reemplazar:

<span class="hljs-string">'core-user-registration'</span> => array(
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_title'</span> => __( <span class="hljs-string">'[{{{site.name}}}] Activate your account'</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_content'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account, go to the following link and click on the <strong>Activate</strong> button:n<a href="</span>{{{activate.url}}}<span class=">">{{{activate.url}}}</a>nnIf the 'Activation Key' field is empty, copy and paste the following into the field - {{key}}"</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_excerpt'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account, go to the following link and click on the 'Activate' button: {{{activate.url}}}nnIf the 'Activation Key' field is empty, copy and paste the following into the field - {{key}}"</span>, <span class="hljs-string">'buddypress'</span> )
),
<span class="hljs-string">'core-user-registration-with-blog'</span> => array(
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_title'</span> => __( <span class="hljs-string">'[{{{site.name}}}] Activate {{{user-site.url}}}'</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_content'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account and site, go to the following link: <a href="</span>{{{activate-site.url}}}<span class=">">{{{activate-site.url}}}</a>.nnAfter you activate, you can visit your site at <a href="</span>{{{user-site.url}}}<span class=">">{{{user-site.url}}}</a>."</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_excerpt'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account and site, go to the following link: {{{activate-site.url}}}nnAfter you activate, you can visit your site at {{{user-site.url}}}."</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-string">'args'</span> => array(
<span class="hljs-string">'multisite'</span> => <span class="hljs-keyword">true</span>,
),
), 

Por

<span class="hljs-string">'core-user-registration'</span> => array(
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_title'</span> => __( <span class="hljs-string">'[{{{site.name}}}] Activate your account'</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_content'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account, go to the following link: <a href="</span>{{{activate.url}}}<span class=">">{{{activate.url}}}</a>"</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_excerpt'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account, go to the following link: {{{activate.url}}}"</span>, <span class="hljs-string">'buddypress'</span> ),
),
<span class="hljs-string">'core-user-registration-with-blog'</span> => array(
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_title'</span> => __( <span class="hljs-string">'[{{{site.name}}}] Activate {{{user-site.url}}}'</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_content'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account and site, go to the following link: <a href="</span>{{{activate-site.url}}}<span class=">">{{{activate-site.url}}}</a>.nnAfter you activate, you can visit your site at <a href="</span>{{{user-site.url}}}<span class=">">{{{user-site.url}}}</a>."</span>, <span class="hljs-string">'buddypress'</span> ),
<span class="hljs-comment">/* translators: do not remove {} brackets or translate its contents. */</span>
<span class="hljs-string">'post_excerpt'</span> => __( <span class="hljs-string">"Thanks for registering!nnTo complete the activation of your account and site, go to the following link: {{{activate-site.url}}}nnAfter you activate, you can visit your site at {{{user-site.url}}}."</span>, <span class="hljs-string">'buddypress'</span> ),
),

Luego te recomendaría que instales el plugin WP Mail SMTP y en dirección del remitente puedas colocar un gmail u otra dirección, siempre y cuando haciendo los tests funcione. Para los test prueba con correos que sean de un dominio propio, tipo @comunicacionabierta.net.

Hagamos de esto una conversación

Deja un comentario

blogroll

Licencia de producción de pares excepto en lo que no sea de mi puño y bit.

Descubre más desde Comunicación Abierta

Suscríbete ahora para seguir leyendo y obtener acceso al archivo completo.

Seguir leyendo