Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

[SOLVED] Using substitutions in connections action

  • Timpowwow
  • Timpowwow
  • OFFLINE
  • Posts: 9
  • Thanks: 2
  • Karma: 0
4 years 9 months ago - 4 years 9 months ago #316714 by Timpowwow
Hello

Been using CB for the past two months, got all the latest builds. Managed to get round a lot of things so far reading the forums and watching videos, but this one's got me stumped!

I'm trying to override the request connection email - it's just plain text. We need a bit more design and html! I created a new auto action, based off onAfterAddConnection, to send an email to the user the request is being made to. I can use substitutions for the currently logged in user, but I can see no docs about how to access the 'other' user's email address (the user that the request is going to) to put in the 'To' field. I know the trigger and action works fine, because I've put my email in.

Any suggestions would be gratefully appreciated!
Last edit: 4 years 9 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
4 years 9 months ago #316717 by krileon
Replied by krileon on topic Using substitutions in connections action
That triggers available variables are as follows.

Code:
$_PLUGINS->trigger( 'onAfterAddConnection', array( $this->referenceId, $connectionId, $ueConfig['useMutualConnections'], $ueConfig['autoAddConnections'] ) );

You won't have access to the recipient users email address from this unless you change the User for the auto action. With the above trigger var1 is your user id and var2 is the user id you're connecting to. For example the below should work.

User: Manually
User Variable: Variable 2

Now substitutions should be based off the user you're connecting to. Next if you need to substitute in something from your own user you can just use the user="#me" usage on your substitution. Example as follows.

[username] = Connections Username
[cb:userdata field="username" user="#me" /] = Your Username


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: Timpowwow

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

  • Timpowwow
  • Timpowwow
  • OFFLINE
  • Posts: 9
  • Thanks: 2
  • Karma: 0
4 years 9 months ago #316719 by Timpowwow
Replied by Timpowwow on topic Using substitutions in connections action
Thank you, wonderful, perfect!
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum