Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Private Messaging - automatically set "Receive an email when ... private message" for new users
Avatar
Sebastian Schimpf
Member
sp_UserOfflineSmall Offline
Sep 24, 2016 - 11:52 am

Hi there,

I am working on a private forum and would like to set up the messaging feature to be easy to use for every body. I believe that the option "Receive an email when someone sends you a private message" should be activated by default for our users because it is challenging to explain to all users that they should activate it to receive an email when getting messages.
The hint for new messages in the inbox is so subtle in the interface that I believe even if people are logged in by chance when they have a new message, they may just overlook the tiny number in the "inbox" button.

Is there a way to activate the "email notification" option by default, so users don't have to activate it manually?

Warm regards,
Sebastian

 

 
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 24, 2016 - 12:13 pm

If you have the option that allows email notifications turned on - then the default for users in their SP profile, should also be on by default...?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Sebastian Schimpf
Member
sp_UserOfflineSmall Offline
Sep 24, 2016 - 12:20 pm

I just created a new user and indeed, the option is activated by default. Yay!
"Problem" solved! 🙂 Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 24, 2016 - 12:34 pm

You're welcome...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Sebastian Schimpf
Member
sp_UserOfflineSmall Offline
Sep 25, 2016 - 4:02 am

Hi Swordfish,
could you tell me how I can change the subject of the notification email that Wordpress sends out through the Private Messaging plugin?

[Image Can Not Be Found]

The emails that I get show the right Sender Name now but the title of the website is put in front of the Subject and it does not make sense here.
Is there a way to modify the subject?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 25, 2016 - 5:41 am

There are 2 ways if doing this. The first would be to install our HTML Email plugin which lets you change virtually all emails that SP sends.

Or - for this particular instance, there is a standard WordPress filter you can use. The filter is:

'sph_pm_email_subject'

and it passes 4 arguments -  $subject, $email, $sender, $newpm);

Whatever you return from the call will be the new subject text.

There are two places to add filter code. One would be in the spFunctions file of your child theme. The other method is to create a new php file in the wp-content folder named 'sp-user-functions.php' which is entirely safe from any update we may make in the future. This file will always be loaded if it exists.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Sebastian Schimpf
Member
sp_UserOfflineSmall Offline
Sep 25, 2016 - 5:47 am

Hi,

I would like to try to use the sph_pm_email_subject.php in /wp-content/.

How do I link this function to only one particular event? I only need to change the subject of the notification for a private message. Other emails that SP sends are fine I think.

And to use the function ...
would it look like this:
sph_pm_email_subject('my subject', 'test@test.com', 'Sender Name', $newpm);

What is "$newpm"?
And how do I put this into a working filter?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 25, 2016 - 5:49 am

Do you not know how to write WordPress filters?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Sebastian Schimpf
Member
sp_UserOfflineSmall Offline
Sep 25, 2016 - 5:52 am

would it look like this?

apply_filters( 'sph_pm_email_subject', ‘my subject’, ‘test@test.com’, ‘Sender Name’, $newpm);

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 25, 2016 - 5:58 am

No.

Like:

add_filter('sph_pm_email_subject', 'your_function_name', 1, 4);
function your_function_name($subject, $email, $sender, $newpm) {
    $subject = 'whatever text you want it to say';
    return $subject;
}

I didn't test this by the way!

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17345
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79600