Editing mail sent upon joining a group

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Editing mail sent upon joining a group

Post by hyper_nova » Fri Sep 23, 2005 11:36 am

Hello all,

I would like to know how and if it's possible to edit the email sent when a person is added to a certain group on my forums and when he is removed.

For example I have 3 groups in my forums A B and C. When somebody is added to group A, and group A only, I want the email sent to him to contain a different message than the deafult one. I also want to edit the mail that is sent when he is removed from group A.

Furthur more, I would like to know how to use the user's username variable in the email I send if it's possible. Example:

If a person who registered with the username "John" has been added to group A on my forums, I would like the email to send the following message:

"Hello John, you have been Added to our group, thank you."

Thank you all for your help in advance. :wink:

hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Post by hyper_nova » Fri Sep 23, 2005 5:57 pm

Anybody ? I got help here on way more complicated issues than this one.

hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Post by hyper_nova » Fri Sep 23, 2005 10:03 pm

Can't anybody help me here ? It's probably a simple file to edit and a variable to retrieve, I just don't know how to do it.

gmex2006
Registered User
Posts: 463
Joined: Mon Jul 25, 2005 1:34 am

Post by gmex2006 » Fri Sep 23, 2005 10:22 pm

Well I am not sure if I can help you exactly but at least I will try.

First concerning the customised texts you can go to your language>lang_english>lang_main.php,

Search for

Code: Select all

$lang['Group_joined']
and then next to it you will find the corresponding text usually sent out by the board,

Code: Select all

$lang['Group_joined'] = 'You have successfully subscribed to this group.<br />You will be notified when your subscription is approved by the group moderator.'
edit it at your convenience

Secondly, this mod may help you to mass e-mail new users.

Now to edit the e-mail sent to the users,
in your language\lang_english\email>group_approved.tpl you will have text that will be sent to the user accepted in the group, you can freely edit it.

Code: Select all

Subject: Your request has been approved
Charset: iso-8859-1

Congratulations,

Your request to join the "{GROUP_NAME}" group on {SITENAME} has been approved.
Click on the following link to see your group membership.

{U_GROUPCP}

{EMAIL_SIG}
Now, next step;

To add the username of the targetted user, please use the following mod

OR you can follow this (the mod actually ;))

Code: Select all

## easymod compliant
##############################################################
## MOD Title:    USERNAME in TPL files
## MOD Author:   Avram < avramyu@gmail.com > (Avramovic Nemanja) http://www.webinsane.com
##
## MOD Description:  This MOD will allow you to use USERNAME inside .TPL files so you can talk to user by his name
## MOD Version:  1.0
##
## Installation Level:  EASY
## Installation Time:   2 minutes
## Files To Edit:       includes/usercp_register.php
############################################################## 

#
#-----[ OPEN ]---------------------------------
#
includes/page_header.php

#
#-----[ FIND ]---------------------------------
#
$template->set_filenames(array(
	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);

#
#-----[ AFTER, ADD ]---------------------------------
#
//insert variable USERNAME into smarty engine
$template->assign_vars(array(
'USERNAME' => $userdata['username']
));

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
# EoM

hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Post by hyper_nova » Fri Sep 23, 2005 11:11 pm

OK this is a good start but I need some more specific info.

First, I want the email to be when someone si added to the group, not apprived. I guess the answer to that is simply editting the group_added.tpl
Second, I want each group to have a special email sent.

for example I have 3 groups on my forums: A B and C
when someone is added to group A I want the message to be: Blah yada
when added to group B: Hello World
and group C: Heya there !

I guess that will involve addign perhaps some condition to the file or I dunno. third, after installing that short mod, how do I actually add the username to my email ? I know very little about PHP, I only know algorithmics very well from my pascal studies.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66565
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie » Fri Sep 23, 2005 11:27 pm

hyper_nova wrote: OK this is a good start but I need some more specific info.

First, I want the email to be when someone si added to the group, not apprived. I guess the answer to that is simply editting the group_added.tpl
Second, I want each group to have a special email sent.

for example I have 3 groups on my forums: A B and C
when someone is added to group A I want the message to be: Blah yada
when added to group B: Hello World
and group C: Heya there !

I guess that will involve addign perhaps some condition to the file or I dunno. third, after installing that short mod, how do I actually add the username to my email ? I know very little about PHP, I only know algorithmics very well from my pascal studies.

the only part I can help with is adding the username to the email.

just add {USERNAME} wherever you want the username to show.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Post by hyper_nova » Sat Sep 24, 2005 12:24 am

Btw, after installing the username mod, it aint working. im adding {USERNAME} into my TPL and it still aint working.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66565
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie » Sat Sep 24, 2005 2:15 am

OK, first, you are right, the group_added.tpl is already sent out when someone is added to a group. now to edit that and put the username in it here you go:

Code: Select all

###################################
#-------OPEN----------
groupcp.php
#-----FIND---------
$emailer->assign_vars(array(
		'SITENAME' => $board_config['sitename'], 
		'GROUP_NAME' => $group_name,
		'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 
						

#-----AFTER ADD--------
'USERNAME' => $userdata['username'],
#
#------OPEN-----------
languages/lang_english/email/group_added.tpl
#------FIND----------
Congratulations
#-----INLINE AFTER ADD---------
{USERNAME}

#-----SAVE CLOSE ALL FILES----------
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

hyper_nova
Registered User
Posts: 26
Joined: Sat Jun 04, 2005 9:53 pm
Location: Israel
Contact:

Post by hyper_nova » Sat Sep 24, 2005 9:21 am

And still people, how do I create a custom email for each group the person is added to ? I don't want someone to be added to group B and get the same email as someone who is added to group A for that matter.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66565
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie » Sat Sep 24, 2005 5:07 pm

that could certainly be done, but you would have to create a different email tpl file for each group, then you would have to create new php code to figure out what group had been joined and then send out the appropriate email.

that is beyond my skills here, but someone in the MOD request forum might be interested in doing it for you, you will have to ask there.

luck,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

mshultise
Registered User
Posts: 1
Joined: Wed Jun 14, 2006 5:51 pm
Location: Captain Cook, Hawaii
Contact:

Languages?

Post by mshultise » Wed Jun 14, 2006 5:59 pm

Excuse a newbie suggestion.

Is there something the OP could do with different languages?

He would create a new language (duplicating English for example), change the email files and set users in Group B to the new language.

Locked

Return to “2.0.x Support Forum”