WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
Use first name / last name in email confirmation instead of user_login (6 posts)

  1. milanouser
    Member
    Posted 1 year ago #

    Hi,

    while I generally like this plugin very much, there are a few things I would love to see:

    1. Could I use first name /last name as variables instead of only user_login in confirmation emails? Of course once those two are mandatory fields in the registration process. So, have something in mails like:
    Howdy %firstname%, or Welcome %firstname% %lastname%, instead of the only option `Hi, %user_login%

    2. How can I insert additional variables into different email types? For example: writing a regular "new user" email allows you to send the password (%user_pass%), but you cannot send password in a user activation message! So, I would like to have one of the two options:

    • After activation (sent by activation email) send another confirmation mail with the login credentials (say: for future reference, these are your login credentials:...), OR
    • Possibility to include login information (%user_login% AND %user_pass%) in the activation email (say: click link to activate your account. Once activated, you can login using your credentials:...)

    Is there an easy way to include one of those two possibilities, say by adding a hook? If not, would that be included into a (near) future update?

    Thanks for any help
    M

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    1. Yes, you can. You can use any variable available to the WP_User object.
    2. See above.
  3. milanouser
    Member
    Posted 1 year ago #

    Jeff, thanks for the good news - and for answering so quickly. Great job!

    Unfortunately I am quite at a loss how to implement that.

    Where and how can I define additional custom replacement variables? Especially to make it "update-proof"?
    Searching your plugin I think I understand that some of the variables are defined in modules\custom-user-links\custom-user-links.php (user_id, username), others in modules\custom-email\custom-email.php.

    Do I have to add my custom variables here, and if so, can I move these files to my theme to keep them save from plugin updates? If yes, where to (special plugin folder?)

    Thanks for any hint
    Cheers,
    M

  4. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    Are you trying to add values that are not stored in the usermeta table?

  5. milanouser
    Member
    Posted 1 year ago #

    Jeff,

    no, all I would like to use is first_name on basically all messages, and password in clear on activation confirmation mail.

    I tried to use%user_pass% variable on user activation message, but that leaves it blank, as it is not defined for this kind of message (only for the regular registration email, it seems).

    For first_name, I know that in PHP I can get use $current_user->user_firstname, but how do I use that in the admin part (i.e. in e-mail messages)?

    Thanks for your continued help!
    M

  6. Jeff Farthing
    Member
    Plugin Author

    Posted 1 year ago #

    First name can be access as %first_name%, as that's how it's stored in the usermeta table.

    After a user activates their account, they should then receive the New User e-mail, so you would include the password there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic