forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 ecards & email => Topic started by: MaxxFusion on July 27, 2006, 09:06:22 pm

Title: Adding Profile Fields to activation email.
Post by: MaxxFusion on July 27, 2006, 09:06:22 pm
I get the notification email when a new user signs up but stock the only thing that comes in the email is the username and email address.  I want to be able to Make the Profile 1 and Profile 2 required fields and have them come in the email.  This way I will know at a glance who the request is from.

How can I do this?

Thanks,
Frank
Title: Re: Adding Profile Fields to activation email.
Post by: Joachim Müller on July 28, 2006, 07:14:34 am
For a start, post a link to your site and a non-admin test user account.
Title: Re: Adding Profile Fields to activation email.
Post by: MaxxFusion on July 28, 2006, 01:27:14 pm
http://www.thepumas.com/login.php

testuser
test
Title: Re: Adding Profile Fields to activation email.
Post by: Joachim Müller on July 28, 2006, 04:20:41 pm
The registration email only containing the username and email address is expected default behaviour, I must have misinterpreted/misread your initial question in the first place, so please accept my apologies for unnecessarily asking you for link and account.
To get the profile fields to show in your email, you'll have to edit register.php, find
Code: [Select]
    // email notification to admin
        if ($CONFIG['reg_notify_admin_email']) {

                        // get default language in which to inform the admin
                        $lang_register_php_def = cpg_get_default_lang_var('lang_register_php');
                        $lang_register_approve_email_def = cpg_get_default_lang_var('lang_register_approve_email');

                                        if ($CONFIG['admin_activation']==1) {
                                                        $act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
                                                        );
                                                        cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_request_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_approve_email_def, $template_vars)));
                                        } else {
                                                        cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name));
                }
                                }
and replace with
Code: [Select]
    // email notification to admin
        if ($CONFIG['reg_notify_admin_email']) {

                        // get default language in which to inform the admin
                        $lang_register_php_def = cpg_get_default_lang_var('lang_register_php');
                        $lang_register_approve_email_def = cpg_get_default_lang_var('lang_register_approve_email');

                                        if ($CONFIG['admin_activation']==1) {
                                                        $act_link = rtrim($CONFIG['site_url'], '/') . '/register.php?activate=' . $act_key;
                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
                                                        );
                                                        // custom hack: add profile fields - start
                                                        $custom_line_break = "\n\r";
                                                        $cutom_email_content = $custom_line_break
                                                                               $profile1.$custom_line_break.
                                                                               $profile2.$custom_line_break.
                                                                               $profile3.$custom_line_break.
                                                                               $profile4.$custom_line_break.
                                                                               $profile5.$custom_line_break.
                                                                               $profile6';
                                                        // custom hack: add profile fields - end

                                                        cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_request_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_approve_email_def, $template_vars).$cutom_email_content));
                                        } else {
                                                        cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name));
                }
                                }
(not tested - please report back).
Title: Re: Adding Profile Fields to activation email.
Post by: MaxxFusion on July 28, 2006, 05:26:23 pm
I have done this and get

Parse error: parse error, unexpected T_VARIABLE in /home/thepumas/public_html/register.php on line 322
Title: Re: Adding Profile Fields to activation email.
Post by: Nibbler on July 28, 2006, 05:28:52 pm
Should be

Code: [Select]
                                                        // custom hack: add profile fields - start
                                                        $custom_line_break = "\n\r";
                                                        $cutom_email_content = $custom_line_break.
                                                                               $profile1.$custom_line_break.
                                                                               $profile2.$custom_line_break.
                                                                               $profile3.$custom_line_break.
                                                                               $profile4.$custom_line_break.
                                                                               $profile5.$custom_line_break.
                                                                               $profile6;
                                                        // custom hack: add profile fields - end
Title: Re: Adding Profile Fields to activation email.
Post by: MaxxFusion on July 28, 2006, 05:34:38 pm
Where does that part go?
Title: Re: Adding Profile Fields to activation email.
Post by: Nibbler on July 28, 2006, 05:38:46 pm
Replaces the part with the typo, here

Code: [Select]
                                                        // custom hack: add profile fields - start
                                                        $custom_line_break = "\n\r";
                                                        $cutom_email_content = $custom_line_break
                                                                               $profile1.$custom_line_break.
                                                                               $profile2.$custom_line_break.
                                                                               $profile3.$custom_line_break.
                                                                               $profile4.$custom_line_break.
                                                                               $profile5.$custom_line_break.
                                                                               $profile6';
                                                        // custom hack: add profile fields - end
Title: Re: Adding Profile Fields to activation email.
Post by: MaxxFusion on July 28, 2006, 08:28:52 pm
That worked.

Thanks