[SOLVED] Using substitutions in connections action

4 years 2 months ago - 4 years 2 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!

Please Log in to join the conversation.

4 years 2 months ago #316717 by krileon
Replied by krileon on topic Using substitutions in connections action
That triggers available variables are as follows.

$_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 to join the conversation.

4 years 2 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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.172 seconds

Facebook Twitter LinkedIn