Support > cpg1.5 email
Correctly adding and using the tag '{EMAIL}'
TeacherMac:
Hi Andrea and all the best for the New Year!
Yes there are 4 areas that can be changed and here are the results I've documented
Adding '{EMAIL}' to line 624 of the first "$template_vars = array" (located on line 620)
Admin Registration notification email: USER_Name & EMAIL variables display correctly
User Registration confirmation email: USER_Name & EMAIL variables display correctly
Admin Registration request email: USER_Name displayed correctly but EMAIL variables displayed as "EMAIL"
User Activation notification email: USER_Name displayed correctly but EMAIL variables displayed as "EMAIL"
Adding '{EMAIL}' to line 675 of the second "$template_vars = array" (located on line 671)
Admin Registration notification email: USER_Name & EMAIL variables display correctly
User Registration confirmation email: USER_Name & EMAIL variables display correctly
Admin Registration request email: USER_Name displayed correctly but EMAIL variables displayed as "EMAIL"
User Activation notification email: USER_Name displayed correctly but EMAIL variables displayed as "EMAIL"
Adding '{EMAIL}' to line 764 of the second "$template_vars = array" (located on line 760)
Admin Registration notification email: USER_Name & EMAIL variables display correctly
User Registration confirmation email: USER_Name & EMAIL variables display correctly
Admin Registration request email: USER_Name displayed correctly but EMAIL variables displayed as "EMAIL"
User Activation notification email: USER_Name displayed correctly but EMAIL variables displayed as "" (Empty Quotes)
Adding '{EMAIL}' to line 799 of the second "$template_vars = array" (located on line 803)
Admin Registration notification email: USER_Name & EMAIL variables display correctly
User Registration confirmation email: USER_Name & EMAIL variables display correctly
Admin Registration request email: USER_Name displayed correctly but EMAIL variables displayed as "" (Empty Quotes)
User Activation notification email: USER_Name displayed correctly but EMAIL variables displayed as "" (Empty Quotes)
I appreciate your time in looking into this matter.
Mac
Αndré:
If there are empty quotes the token has been replaced successfully, but unfortunately $email is empty/doesn't exist at that point. Maybe the email address exists in another variable/array, if not, you have to get it from the SQL database.
TeacherMac:
I do appreciate your pointing out the obvious as I did take the time to try to find an answer.
I finally asked for support here and was actually hoping for some help with the coding, specifically in how to retrieve the information from the database and apply it where I needed it.
I hope someone else might be able to help.
Have a good year.
Thanks for our help,
Mac
Αndré:
If your gallery is unbridged, something like
--- Code: ---$email = mysql_result(cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$row['user_name']}' LIMIT 1"), 0);
--- End code ---
should populate the $email variable. As I haven't tested the code it may contain typos. Please add it above $template_vars = array( and report if it works as expected.
TeacherMac:
Thank you André! :D
That's the help I needed and the code worked fine ( no typos I guess lol)
To help others who may appreciate this, I inserted the code you provided: "$email = mysql_result(cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$row['user_name']}' LIMIT 1"), 0);"
before "$template_vars = array( " in the file register.php which is located in the root directory which only had to be done in two locations as shown below.
The code inserted on (my line 759) enabled the variable "EMAIL" to be displayed correctly in the user's "Activation notification" email.
(755) //after admin approves, user receives email notification
(756) if ($user_status == 'active_admin') {
(757)
(758) msg_box($lang_register_php['information'], $lang_register_php['acct_active_admin_activation'], $lang_common['continue'], 'index.php');
(759)$email = mysql_result(cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$row['user_name']}' LIMIT 1"), 0);
(760) $template_vars = array(
(761) '{SITE_LINK}' => $CONFIG['site_url'],
(762) '{USER_NAME}' => $row['user_name'],
(763) '{SITE_NAME}' => $CONFIG['gallery_name'],
(764) '{EMAIL}' => $email,
(765)
(766) );
The code inserted on (my line 799) enabled the variable "EMAIL" to be displayed correctly in the administrator's "Registration request" email.
(798) $act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
(799)$email = mysql_result(cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$row['user_name']}' LIMIT 1"), 0);
(800) $template_vars = array(
(801) '{SITE_NAME}' => $CONFIG['gallery_name'],
(802) '{USER_NAME}' => $row['user_name'],
(803) '{ACT_LINK}' => $act_link,
(804) '{EMAIL}' => $email
(805) );
Thanks again for your assistance and please mark this as SOLVED!
Mac
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version