Hello,

I tested this module and noticed that the placeholder !username in the email does not use the themed username.
Would it be possible to make this use the themed username?

Thank you!

Comments

Bilmar’s picture

subscribing
I would appreciate it very much if it was the themed username as well.
Regards

robby.smith’s picture

Hi,

I'm coming over from #727676: Token support
It seems like token support will not be available anytime soon in 6.x of this module, but it would be great if the !username can be changed to use the themed username.

This will greatly benefit those customizing the username in template.php or using realname module.
Can this please be looked into?

Thanks!

jaydub’s picture

The question I have about using the themed username is that normally theme('username') is meant to return you an HTML link to the user's profile. The email sent by email_confirm and Drupal core itself is text only so I'm wondering how you square text emails with the HTML themed username?

That being said I think the solution for this and others is to introduce a new hook that will allow the replacement variables for things such as !username to be altered. This has the advantage of not requiring Token module but still allowing for the use of Token in the hook implementation for your specific site.

Bilmar’s picture

Hi jaydub,

The themed username was added into Mail Editor module at #792244: Add !username_themed; replace Subscriptions' *_realname? with the below lines. This allowed the themed username to be added without html into the emails being sent out. I look forward to following your work and helping with any testing needed.

I appreciate you looking into this.

       $tokens['!username']= "User's username";
+      $tokens['!username_themed']= "User's username (themed)";
       $tokens['!site']= 'Site name';
       $tokens['!login_url']= 'One time login URL for password reset';
       $tokens['!uri_brief']= "Website's URL without the leading http://";
@@ -48,6 +49,7 @@
   $account = $mail['params']['account'];
   $language = $mail['language'];
   $tokens = array(
+    '!username_themed' => strip_tags(theme('username', $account, array('plain' => TRUE))),
     '!username' => $account->name,
     '!site' => variable_get('site_name', 'Drupal'),
     '!login_url' => user_pass_reset_url($account),
YK85’s picture

Hello jaydub, is this something that you would be able to add to your module? Thanks!

YK85’s picture

Kindly bumping - the themed username is used by many contrib modules and I really hope this awesome module will do so as well.

YK85’s picture

Status: Active » Closed (fixed)

Sorry, this was resolved with the Mail Editor module integration.
(but it is still not in the core Email Change Confirmation module)

Thanks for this great module!

jaydub’s picture

Status: Closed (fixed) » Active

Reopening this until the patch for Mail Edit support is committed pending review.

jaydub’s picture

Status: Active » Closed (fixed)

Closing as the Mail Editor integration work was committed long ago.