admin_send_email.txt not showing {USERNAME}

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
User avatar
cancertalk
Registered User
Posts: 21
Joined: Tue Jun 12, 2018 10:51 pm
Name: Vincent Gledhill

admin_send_email.txt not showing {USERNAME}

Post by cancertalk »

Hello People. I have edited the template admin_send_email.txt to read the following

Code: Select all

Hi {USERNAME}
{MESSAGE}

{EMAIL_SIG}
However, when the e-mail goes out, there is no "username" in the e-mail. The message is present, and so is the signature, but no username.

Any ideas why?
Last edited by Mick on Sat Jul 27, 2024 4:54 pm, edited 1 time in total.
Reason: Solved.
I'm trying to save the world of cancer by spreading the work of Professor Thomas Seyfried.
My YouTube Channel https://YouTube.com/@metcancer
My Website https://metcancer.com
My Community forum https://metcancer.com/forum
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3858
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: admin_send_email.txt not showing {USERNAME}

Post by Kailey »

cancertalk wrote: Fri Jul 26, 2024 10:29 am Any ideas why?
You can't just add vars to the email template; it needs to know what those vars refer to. I haven't tested this but try adding the var to /includes/acp_email.php around line 205.

Code: Select all

				$template_data = array(
					'USERNAME'	=> $row['username'],
					'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx),
					'MESSAGE'		=> html_entity_decode($message, ENT_COMPAT),
				);
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
User avatar
cancertalk
Registered User
Posts: 21
Joined: Tue Jun 12, 2018 10:51 pm
Name: Vincent Gledhill

Re: admin_send_email.txt not showing {USERNAME}

Post by cancertalk »

Sorry, I thought that {USERNAME} was a variable in the system, like {MESSAGE} and {EMAIL_SIG}
I'm trying to save the world of cancer by spreading the work of Professor Thomas Seyfried.
My YouTube Channel https://YouTube.com/@metcancer
My Website https://metcancer.com
My Community forum https://metcancer.com/forum
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53514
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}

Re: admin_send_email.txt not showing {USERNAME}

Post by Brf »

cancertalk wrote: Sat Jul 27, 2024 11:08 am Sorry, I thought that {USERNAME} was a variable in the system, like {MESSAGE} and {EMAIL_SIG}
No such thing. Those are template variables. They are created by each script as they need them.

Return to “phpBB Custom Coding”