Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How to include article contents in email

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
8 years 7 months ago #279994 by boyjahq
I would like to include the contents of a specific article in the body of the automatically generated email that accompanies CB registration. How can I do that?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 7 months ago #280019 by krileon
Replied by krileon on topic How to include article contents in email
You can't, we've no features for such usage. You'll need to directly add the contents of the article to the email body language string or within CB > Configuration > Registration if you're talking about the Welcome or Pending emails.


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.

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
8 years 6 months ago #280330 by boyjahq
Replied by boyjahq on topic How to include article contents in email
I wanted to include the text of our Terms of Service page in the confirmation mail generated when a user registers. I wanted it to come from the article so that, in the event that the terms are modified by the site owners, they only have to edit that page and the text is carried through to all functions where it was needed. I did not want the site owners to have to mess around with cutting and pasting updated text into a languag string file.

Here is the solution I finally came up with:

I created a new CB field of type Query, called it TOS RETRIEVAL, which created the field name cb_tosretrieval

I set it to show on profile but made it a hidden field by typing the word "hidden" (without quotes) in the CSS Class box.

For Parameters/Query I used the following code:
SELECT `introtext` FROM `y2vfp_content` WHERE `id` = 127;

Someone else would substitute the "y2vfp" part with whatever prefix your tables have, and you would also need to use the article id from the article you intend to use. The article id for mine was 127.

In my email template I am now able to insert the article contents with the substitution [cb_tosretrieval]

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago #280350 by krileon
Replied by krileon on topic How to include article contents in email
You can exclude y2vfp and simply use #_ in its place to avoid the dependency. Example as follows.

Code:
SELECT `introtext` FROM `#__content` WHERE `id` = 127;


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.

  • boyjahq
  • boyjahq
  • OFFLINE
  • Posts: 473
  • Thanks: 33
  • Karma: 3
8 years 6 months ago #280364 by boyjahq
Replied by boyjahq on topic How to include article contents in email
Yes, I tried that first and it generated an error, indicating that the #_ part was not being replaced ( No Such Table #_content), so I hard coded it to get it functioning.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 6 months ago #280452 by krileon
Replied by krileon on topic How to include article contents in email
You need to use 2 underscores. See my above example.


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.
The following user(s) said Thank You: nant, paxx

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

Moderators: beatnantkrileon
Powered by Kunena Forum