Skip to Content Skip to Menu

AutoAction Email type: Substitutions to show Viewing User info

  • jcrimmel
  • jcrimmel
  • OFFLINE
  • Posts: 44
  • Thanks: 9
  • Karma: 2
11 months 2 weeks ago - 11 months 2 weeks ago #336204 by jcrimmel
I have an AutoAction Email type sending an email after a user adds a new item into a Gallery. In my instance, it is always a CB Moderator editing or adding information to all CB profiles The email works perfectly to alert that the Gallery was updated, but shows the info for the Action User, whereas I need it to show for the Viewing User. So, that when a new item is added to a Gallery I can alert my Team that an addition was made to that particular profile.

Below are the substitutions I'm using, but this returns info for the Action User. I have read some posts about using #displayed, but that hasn't worked yet for me. Any suggestions on how to make this happen?
Code:
[cb:userfield field="formatname" reason="reason" /] [cb:userfield field="avatar" reason="list" /]
Last edit: 11 months 2 weeks ago by jcrimmel.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
11 months 2 weeks ago #336209 by krileon
Use the "user" parameter in your substitutions to force the substitution to be from the viewing user instead of the auto action user. Example as follows.

[cb:userfield field="avatar" user="#me" reason="list" /]

Below are the special user values available.

#me = always viewing user
#displayed = always displayed user
#displayedOrMe = displayed user if they exist otherwise viewing user


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.

  • jcrimmel
  • jcrimmel
  • OFFLINE
  • Posts: 44
  • Thanks: 9
  • Karma: 2
11 months 2 weeks ago - 11 months 2 weeks ago #336211 by jcrimmel
If I use the following I get a single comma as the result. Confident the user has an avatar
Code:
[cb:userfield field="avatar" user="#displayed" reason="list" /]
I've tried this with other fields I know are populated as well, and still get a single comma as the result. 



If I use the following I get my own image, the logged in user.
Code:
[cb:userfield field="avatar" user="#me" reason="list" /]
Code:
[cb:userfield field="avatar" user="#displayedOrMe" reason="list" /]
So, this works, but not the user I need returned.
Last edit: 11 months 2 weeks ago by jcrimmel.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
11 months 2 weeks ago #336217 by krileon
#displayed only works explicitly on profile display. It won't be of any use in your auto action. It doesn't work anywhere else.

So, this works, but not the user I need returned.

I understood you needing the viewing user? That's what #me does. If not please clarify "but shows the info for the Action User, whereas I need it to show for the Viewing User" as I'm not sure what user you're trying to get information from.


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.

  • jcrimmel
  • jcrimmel
  • OFFLINE
  • Posts: 44
  • Thanks: 9
  • Karma: 2
11 months 2 weeks ago #336222 by jcrimmel
I'm trying to return the info for the user that is displayed on the screen as being edited. If I log in under my account and upload a file into "Bob Smith's" gallery, I need the email to say Bob Smith's gallery was updated. 

I have tried the below, but it only returns a single comma as a result:
Code:
[cb:userfield field="avatar" user="#displayed" reason="list" /]


The #me parameter works fine to return my (the logged in user) info, but #displayed just returns a "," no matter what field I try to return.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
11 months 1 week ago #336230 by krileon
You'll have to get that information likely from the trigger. What trigger are you using? Again, #displayed only works for content directly rendered on profiles. It won't apply anywhere else and is pretty much exclusively for display usages (e.g. custom html fields).


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