Customize email sent from profile

13 years 10 months ago #135259 by ottergirl
Customize email sent from profile was created by ottergirl
I'd like to add the recipients name in the message being sent through the profile messaging system. How do I do that?

Please Log in to join the conversation.

13 years 10 months ago #135268 by krileon
Replied by krileon on topic Re:Customize email sent from profile
You can customize the language strings sent with the Email and add substitutions such as [name], [username], etc... at the following location.

In: components/com_comprofiler/plugin/language/default_language/default_language.php
On: Lines 391-394
[code:1]
DEFINE('_UE_SENDEMAILNOTICE',"
This is a message from %s at %s ( %s ) to you:
\r\n\r\n"«»);
DEFINE('_UE_SENDEMAILNOTICE_REPLYTO',"\r\n\r\nWhen replying, please check carefully that the email address of %s is %s."«»);
DEFINE('_UE_SENDEMAILNOTICE_DISCLAIMER',"\r\n\r\n
NOTES:
\r\n\r\nThis user did not see your email address. If you reply the recipient will have your email address.\r\n\r\n%s owners cannot accept any responsibility for the contents of the email and of user email addresses."«»);
DEFINE('_UE_SENDEMAILNOTICE_MESSAGEHEADER',"\r\n\r\n\r\n
Message from %s to you:
\r\n\r\n"«»);
[/code:1]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 10 months ago #135277 by ottergirl
Replied by ottergirl on topic Re:Customize email sent from profile
I looked at that but was still perplexed as to what to use to designate the recipient name. The %s throws me as I can't figure out what it refers to. Sorry for the confusion but I just don't understand the code yet. What could I replace the 'you' with in the line

DEFINE('_UE_SENDEMAILNOTICE',"
This is a message from %s at %s ( %s ) to you:
\r\n\r\n");

to show the recipient's name? Thank you -

Please Log in to join the conversation.

13 years 10 months ago #135367 by krileon
Replied by krileon on topic Re:Customize email sent from profile

The %s throws me as I can't figure out what it refers to.

The %s signifies the string is used within a sprintf, which means the %s is to be replaced inside PHP by something such as a username, etc...

What could I replace the 'you' with in the line

You should use substitutions in such a case for example [name]. Please see changed language string as follows. More information on substitutions can be found within Tutorials from my signature.

[code:1]
DEFINE('_UE_SENDEMAILNOTICE',"
This is a message from %s at %s ( %s ) to [name]:
\r\n\r\n");
[/code:1]

Post edited by: krileon, at: 2010/06/11 15:11


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 10 months ago #135667 by ottergirl
Replied by ottergirl on topic Re:Customize email sent from profile
Thanks for the reply. However, I still don't know the substitution to use for the email recipient's name. I tried using [name] just to see what would appear, but it just says [name] in the email - no substitution at all. Is there a list of field names somewhere that defines the ones recognized in the email function? Thank you -

Please Log in to join the conversation.

13 years 10 months ago #135803 by krileon
Replied by krileon on topic Re:Customize email sent from profile

I tried using [name] just to see what would appear, but it just says [name] in the email - no substitution at all.

This unfortunately means the language strings do not support substitutions, sorry. The name should already be included in the email either by way of username or name depending on how you've configured CB to display formatname field (CB Configuration > General > Name Format).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.248 seconds

Facebook Twitter LinkedIn