latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

New User Email Message question

Home Forums Community Forum New User Email Message question

This topic contains 9 replies, has 4 voices. Last updated by  Eduan 3 years, 10 months ago.

Topic Author Topic
Posted: Friday Feb 15th, 2013 at 2:49 am #41786

My site has members from different countries… read -> different languages.
I thus wanted to customize the New User Email Message to display in the language of the user. I tried this:

<?php
$lang = get_user_field("_taal_")

if ($lang=="NL")
{
$msg("Hallo %%user_first_name%%," .
,"", .
"Bedankt voor je inschrijving bij Reiki magazine Online", .
"Dit is je gebruikersinformatie:", .
"Gebruikersnaam: %%user_login%%", .
"Password: %%user_pass%%", .
"Geregistreerd emailadres: %%user_email%%", .
"Je kan inloggen op de startpagina rechtsboven.", .
"Ik hoop het uiteraard niet, maar mocht je ooit je abonnement willen opzeggen dan doe je dat nadat je ingelogd bent.", .
"Ga naar je profiel pagina. Daar kom je door eerst in te loggen en dan te kiezen voor "Edit my profile"", .
"Onderaan staat een knop 'Unsubscribe'", .
"Klik daarop. Hiermee worden automatische vervolgbetalingen stopgezet. Je abonnement wordt stopgezet nadat je huidige abonnementsperiode is verlopen." );
}

if($lang=="EN")
{
$msg("Hello %%user_first_name%%,", .
"Thank you for subscribing to Reiki Magazine Online.", .
"", .
"Your Username/Password:", .
"Username: %%user_login%%", .
"Password: %%user_pass%%", .
"", .
"You can log in at the homepage (right upper corner).", .
"In case you might want to stop your subscription at some time in future you can do so once you are logged in.", .
"The membership login box at the top-right corner changes from membership login to "My Profile Summary" Click on "Edit my profile".", .
"At the bottom of the page you see a button "unsubscribe". Click on that to unsubscribe from Reiki Magazine Online.", .
"Any recurring payments will stop and your subscription will expire after the current timeslot of you subscription.");
}
$arrlength=count($msg);
$bericht = ""
for($x=0;$x<$arrlength;$x++)
   {
   $bericht = $bericht + $msg[$x] + &quot;<br>";
   }
echo $bericht
?&gt;

This is not working at all. I get the full php code in the message.
So the question is, is there a way to create a message depending on the language of the new user?
FYI, I do have a custom field “_taal_” that displays the language of choice.
For now I stick to repeating the message in 3 different languages. (Dutch, German, English) in one mail.

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Saturday Feb 16th, 2013 at 9:27 pm #42010
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

This is not working at all. I get the full php code in the message.

Where is this being input, or hooked? Are you putting this code into the New User Registration Email directly? If so, this is the issue. s2Member does not support PHP here. If you need to dynamically set this I’d recommend hooking into the wp_mail filter instead.

See: http://codex.wordpress.org/Function_Reference/wp_mail

Posted: Sunday Feb 17th, 2013 at 12:09 am #42014

I do understand the wp_mail function. But I cannot find how I can hook that function into s2member.

Posted: Sunday Feb 17th, 2013 at 10:13 pm #42221
Eduan
Username: Eduan
Moderator

Hello Boudewijn,

I think you would use this wp_mail() function in an MU plugin.

Also, you wouldn’t hook this into s2Member, you would hook this into WordPress, because the new user email is handled by WordPress.

Now, don’t take this for granted, because I’m not sure, just telling you what I think with my small knowledge. :)

– Eduan

Posted: Monday Feb 18th, 2013 at 2:04 am #42239

Hi Eduan,

Tx for the reply. I must admit that PHP still has quite a few secrets for me and basically I still am not sure whether I want to know all the work that is involved in this. All I am interested in is setting up websites where I can make money. Customizing code and the lot is not really making money for me, therefore I am a raving fan of good plugins that do the work for me. I’d rather spend my time to work on Kindle books or creating/optimize my sites.

Posted: Monday Feb 18th, 2013 at 5:59 am #42243
Andaluzo
Username: andaluzo

I have the same Problem and could not figure out how to set up a multilanguange version.

Even if you have a blank german WP-installation, the User Emails goes out in english even if you translate it in the .po .mo file.

I wish the developers would give us some more help. It would be easy for them to put a section with all Mails which are going out, into the admin panel, in that way the user would have more possibilities to alter this Email content and in a Multisite Environment it would be easy to set up a Multilanguage website with s2member.

Keep up the good work!

Posted: Monday Feb 18th, 2013 at 10:14 am #42265
Eduan
Username: Eduan
Moderator

I’m sorry I can’t provide any more help Boudewijn. :/ :(

Andaluzo, I will pass this on to Jason as a feature request, a way to modify all the emails that go out in a more concise place and with more advanced features if possible. Is that OK with you?

– Eduan

Posted: Monday Feb 18th, 2013 at 10:32 am #42269
Andaluzo
Username: andaluzo

Absolut fine !

Gracias Eduan.

Posted: Monday Feb 18th, 2013 at 10:33 am #42270
Andaluzo
Username: andaluzo
Posted: Monday Feb 18th, 2013 at 11:53 am #42282
Eduan
Username: Eduan
Moderator

No problem. :)

Viewing 9 replies - 1 through 9 (of 9 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.