Skip to Content Skip to Menu

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

Can't Get Substitutions to Work in Auto Actions

  • davisJ
  • davisJ
  • OFFLINE
  • Posts: 51
  • Thanks: 0
  • Karma: 0
8 years 3 weeks ago #286714 by davisJ
I just watched the Auto Actions 1 tutorial and am trying to get substitutions working as shown in the tutorial - ie. when a user logs in, I want an email to be sent to myself with the user's username.

I tried including [username] in the subject and body of the html emails, as shown by Nant in the tutorial. The emails were sent but the substitution wasn't included in the email subject or body. I also tried using [cb:userdata field="username" /] but this made no difference.

I also tried setting the Content Plugins parameter to Yes, but this didn't work.

Any idea what I'm doing wrong?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 3 weeks ago - 8 years 3 weeks ago #286733 by krileon
Sending an email on every login is probably going to be a lot of spam, but it should be doable with the below for example.

Global
Triggers: onAfterLogin
User: Automatic
Access: Everybody
Action
To: YOUR_EMAIL_ADDRESS_HERE
Subject: A user has logged in
Body: [username] has logged in

You shouldn't need any further advanced parameters beyond this. So reload user doesn't need to be enabled, reference variables don't need to be set, leave format functions off, and you don't need content prepare.


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.
Last edit: 8 years 3 weeks ago by krileon.
The following user(s) said Thank You: davisJ

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

  • davisJ
  • davisJ
  • OFFLINE
  • Posts: 51
  • Thanks: 0
  • Karma: 0
8 years 2 weeks ago #286772 by davisJ
Thanks Kyle, I used onAfterUserLoginSuccess as the trigger and seems the substitution didn't work for this trigger.

When I tried it with the other trigger, ie. onAfterLogin - the substitution worked.

As you said in another thread, "you don't need to be a programmer" to work Auto Actions but without insight into the workings of the triggers, it'd be pretty hard to work out why one trigger works with substitutions and another one doesn't.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
8 years 2 weeks ago #286792 by krileon

Thanks Kyle, I used onAfterUserLoginSuccess as the trigger and seems the substitution didn't work for this trigger.

That trigger doesn't provide a user object so to use that one you need to set User parameter to User so substitutions will be from the user who just logged in.

As you said in another thread, "you don't need to be a programmer" to work Auto Actions but without insight into the workings of the triggers, it'd be pretty hard to work out why one trigger works with substitutions and another one doesn't.

You only need to know a triggers variables and hopefully that will make things clear enough. We'll be working on better documentation for triggers themselves, what variables they have, what they do and when, etc.. For now we have the below though, but it doesn't have the newer triggers listed.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers

If you're ever unsure of what trigger to use then please do ask as we're here to help. :)


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