Skip to Content Skip to Menu

[SOLVED] Substitutions in the language strings

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
10 years 9 months ago - 10 years 9 months ago #239467 by ricco1
Hi,

I'm trying to include the name and/or the username of the receiving user in the email that is being sent when the Send Email link is used from the profile. Is this possible?

The language string is _UE_SENDEMAILNOTICE

I've tried [FIELD_NAME] , [cb:userdata field="FIELD_NAME" /] , [cb:userfield field="FIELD_NAME" /] without success.

This would be very useful as it will make the email much more original, e.g.:

"Mysite sent this message to Name Surname (username).
Your registered name is included to show this message originated from Mysite."


Could you suggest a solution please?

Thank you
Last edit: 10 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239494 by krileon
Replied by krileon on topic Substitutions in the language strings
You can't add substitutions to the notice. It's used in way too many locations for that to be supported. As for the email subject and body that won't be added either as that's user supplied information, which could easily be abused if they knew how to use substitutions. The from name and address will be the users own though so that seams personalized enough.


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 or Create an account to join the conversation.

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
10 years 9 months ago - 10 years 9 months ago #239525 by ricco1
Replied by ricco1 on topic Substitutions in the language strings
Hi Kyle,

with all due respect, I think I have to contradict here.

It doesn't matter to me in how many locations you've used that string.

Let me say why I think you are not right:

First of all it's not just a notice it's an official email sent from one user to another user through our site and it could be very easily mistaken as an unwanted letter.

Then, in the subject or in the message the sender can write anything he, she or "it" wants.

The main problem is that it's not completely evident to the receiver that the email came from our site.

Here is what are the original strings, I've removed a few of the "-" to be clearer:

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");

Here is what I've manage to make:

DEFINE('_UE_SENDEMAILNOTICE',"Dear Example Site Member,\r\n\r\n\"%s\" has sent this email to you through the %s ( %s ) mailing system.\r\n\r\nHere is the message that was sent to you:\r\n\r\n--\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--\r\n\r\n\r\nNOTES:\r\n\r\nExample Site takes no liability for the sending of this email or its content.\r\n\r\nThe sender did not see your email address but if you reply the recipient will have your email address.\r\n\r\nYou can report this message as unsolicited (spam/spoof) email by forwarding it to: spam.reports@ExampleSite.com");
DEFINE('_UE_SENDEMAILNOTICE_MESSAGEHEADER',"\r\n\r\n\r\nMessage from %s to you:\r\n\r\n");

In this case the receiver gets an email with whatever Subject, with whatever Message, and with WHATEVER FROM NAME e.g. John Grisham @ ExampleSite.com [exampleemail@yahoo.com]

I think this is not efficient to make our emails stand out. I think we have to include the name, the username or both in the email that the receiver gets.

Please consider it and inform me if you make progress on this.

Thank you
Best regards
Ricco
Last edit: 10 years 9 months ago by ricco1.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239557 by krileon
Replied by krileon on topic Substitutions in the language strings
I think I'll be able to split the footer into 2 separate footers. 1 with substitutions and 1 without then have it use either/or depending on if a user object is available or not. The API can send from "system", which is why the footer is generic as there isn't always a user object available.


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 or Create an account to join the conversation.

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
10 years 9 months ago #239563 by ricco1
Replied by ricco1 on topic Substitutions in the language strings
Super. Thank you.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 9 months ago #239564 by krileon
Replied by krileon on topic Substitutions in the language strings
Ok, improved notification API functionality. Footers and other non-user supplied information supports substitutions completely now. User supplied content (subject and message) require a parameter to be enabled at the usage. This should solve your issues as you'll be able to put [name] for example in the footer now.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum