Guest User

Untitled

a guest
Oct 21st, 2017
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. //Primero configuramos nombre y email del remitente
  2.  
  3. //Este es el filtro del mail de remitente:
  4.  
  5. add_filter('wp_mail_from', 'new_mail_from');
  6.  
  7. //Este es el filtro para el nombre del remitente:
  8.  
  9. add_filter('wp_mail_from_name', 'new_mail_from_name');
  10.  
  11. //Aquí es donde va el nuevo email remitente. Cámbialo a tu gusto
  12.  
  13. function new_mail_from($old) {
  14. return 'miemail@midominio.com';
  15. }
  16.  
  17. //Aquí es donde va el nombre del remitente
  18.  
  19. function new_mail_from_name($old) {
  20. return 'Nombre del remitente';
  21. }
  22.  
  23. //A continuación hacemos un gancho en el asunto y configuramos una función para cambiarlo
  24.  
  25. add_filter( 'wpmu_signup_user_notification_subject', 'my_activation_subject', 10, 4 );
  26.  
  27. function my_activation_subject( $text ) {
  28.  
  29. //Aquí es donde introducimos el nuevo asunto para el email de activación
  30.  
  31. return 'Personalízame: Tienes que activar tu cuenta o lo que sea que quieras poner.';
  32. }
  33. // Para finalizar hacemos un gancho en el email y ejecutamos una función para modificar el mensaje
  34.  
  35. add_filter('wpmu_signup_user_notification_email', 'my_custom_email_message', 10, 4);
  36.  
  37. function my_custom_email_message($message, $user, $user_email, $key) {
  38.  
  39. //Y este es el nuevo mensaje
  40.  
  41. $message = sprintf(__(( "Para activar tu cuenta haz clic en el enlace siguiente:\n\n%s\n\n Luego bla bla bla.\n\n" ),
  42. $user, $user_email, $key, $meta),site_url( "?page=gf_activation&key=$key" ));
  43.  
  44. return sprintf($message);
  45.  
  46. }
Add Comment
Please, Sign In to add comment