MyBB Community Forums

Full Version: Add More Options While Mass Mailing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If you want to make additional "Personalize Messages" and to give more options while creating Mass Mailing, then this tutorial is for you. For more info: http://community.mybb.com/thread-105964.html

(2011-10-15, 10:03 PM)Jason L. Wrote: [ -> ]I think it would be useful if we can have custom PM functions. By this I mean in PM's we can say something like this:

Quote:Hello {username},

Hi my name is {myprofile} and I am just here to say hello.

Thanks!
{myusername}
{myemail}

Then it will output something like this:

Quote:Hello faviouz,

Hi my name is Jason L. and I am just here to say hello.

Thanks!
Jason L.
[email protected]

eh?

Lets start on the editing.

At the beginning of this tutorial, your Mass Mail page will be shown like this;
[attachment=24461]

Open ./admin/modules/user/mass_mail.php and find;
	$replacement_fields = array(
		"{username}" => $lang->username,
		"{email}" => $lang->email_addr,
		"{bbname}" => $lang->board_name,
		"{bburl}" => $lang->board_url
	);
Note: the above code will be shown in two instances, you've to edit both instances.

And Change it into;
	$replacement_fields = array(
		"{username}" => $lang->username,
		"{email}" => $lang->email_addr,
		"{bbname}" => $lang->board_name,
		"{bburl}" => $lang->board_url,
		"{myprofile}" => $lang->my_profile,
		"{myusername}" => $lang->my_username,
		"{myemail}" => $lang->my_email
	);

Now open ./inc/languages/english/admin/user_mass_mail.lang.php and find;
$l['board_url'] = "Board URL";
and Add the following code just Beneath it;
$l['my_profile'] = "My Profile";
$l['my_username'] = "My Username";
$l['my_email'] = "My Email";

At this point your Mass Mail Page will become like this;
[attachment=24462]

Now open ./inc/tasks/massmail.php and find;
			$replacement_fields = array(
				"{uid}" => $user['uid'],						
				"{username}" => $user['username'],
				"{email}" => $user['email'],
				"{bbname}" => $mybb->settings['bbname'],
				"{bburl}" => $mybb->settings['bburl'],
				"[".$lang->massmail_username."]" => $user['username'],
				"[".$lang->email_addr."]" => $user['email'],
				"[".$lang->board_name."]" => $mybb->settings['bbname'],
				"[".$lang->board_url."]" => $mybb->settings['bburl']
			);

and Change it into;
			$my_profile = '[url='.$mybb->settings['bburl'].'/member.php?action=profile&uid='.$mybb->user['uid'].']'.$mybb->user['username'].'[/url]';
			$replacement_fields = array(
				"{uid}" => $user['uid'],						
				"{username}" => $user['username'],
				"{email}" => $user['email'],
				"{bbname}" => $mybb->settings['bbname'],
				"{bburl}" => $mybb->settings['bburl'],
				"{myprofile}" => $my_profile,
				"{myusername}" => $mybb->user['username'],
				"{myemail}" => $mybb->user['email'],
				"[".$lang->massmail_username."]" => $user['username'],
				"[".$lang->email_addr."]" => $user['email'],
				"[".$lang->board_name."]" => $mybb->settings['bbname'],
				"[".$lang->board_url."]" => $mybb->settings['bburl']
			);

This'll personalize both your Mass Emails and Mass Private Messages.

Now when you Create a New Mass Mail, it'll look something like this;
[attachment=24463]

And when you send a Private Message for example, it'll show to the end user like this;
[attachment=24464]

Thanks for reading.
I didnt really mean it like this...I meant when you send a PM and type multiple recipients.
I guess he meant through normal PMs, like any user can use, but not like sending from ACP.