Is there a way to use php code in email templates? My needs: In my send_signup_mail template I want to be able to direct new users to a URL that includes their login name. My config is set to allow spaces in logins and I am sending the email using plain text. If I set up the email template with the text ".../path/{$login}" and the user enters a login that has a space, the email will direct the user to a URL like ".../path/my login" instead of to ".../path/my_login". I would like to use the php function urlencode(), but I don't know where to place it. Three solutions I have considered are Place php code inside the brackets in the template. {urlencode($login)} doesn't work, but I may just have the syntax wrong. Add a new variable in the file that generates the email variables. This could be the answer, but I can't find which file has the function mail_verification_email() Add a new field for the url encoded login, add code somewhere to generate the value, and add code somewhere else to allow the template to recognize the field. I don't mind doing this, but it seems like a lot of needless code and database space to simply reformat the output of existing data. Thanks.