Auto Action use cases

4 years 11 months ago #311634 by ljalg
Auto Action use cases was created by ljalg
Hello,

I'm trying to convince my organization to purchase the professional subscription, but I need to make sure our use cases can be satisfied. We are interested in change logging as well as the auto-actions plugin, but I want to ensure the auto-actions can do what we need, I tried the demo and the usability wasn't apparent. Please let me know if the following use cases can be satisfied with auto-actions and what settings are needed to achieve them.

Send email on date
We create a custom field with a "next action" date for that member, the auto-action would send an email to one more more specified email addresses when that date is current or has passed. Can the frequency of the cron be set with this plugin?

Send email on email or postal address change
when a user updates their email or postal address an email is sent to 2 addresses.

Thank you,

Louis
mpyc.org Webmaster

Please Log in to join the conversation.

4 years 11 months ago #311637 by krileon
Replied by krileon on topic Auto Action use cases

Send email on date
We create a custom field with a "next action" date for that member, the auto-action would send an email to one more more specified email addresses when that date is current or has passed.

That's doable using the Internal Users trigger, which loops your entire user base through your auto action. This does have support for batching (e.g. running 1000 users through per batch) for larger sites.

Can the frequency of the cron be set with this plugin?

Yes, you can run the Internal Users CRON URL as often as you like. If using the batching functionality you'd probably want to run it at least once a day.

Send email on email or postal address change
when a user updates their email or postal address an email is sent to 2 addresses.

Yes, you can do that using CB Auto Actions acting on the after user update trigger which is fired when their profile is updated; you'd then just compare the old value against the new to see if it was changed in the Conditions of your auto action. Alternatively you could just use CB Profile Update Logger.


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

Please Log in to join the conversation.

4 years 10 months ago #312164 by ljalg
Replied by ljalg on topic Auto Action use cases
Thank you for your information. We have become Professional Members and have downloaded and set up the Profile Update Logged and Auto Actions plugins. I have already created several Auto Actions which I feel should be very handy.

A few follow-up questions on these topics and one other:
For the Send Email for any users who's Alert Date is earlier than today, I have created an "Alert Date" field and in the Auto Action...
  1. I have set the Conditions to be to compare the Alert Date field to be "less than or Equal to" but I'm unsure what variable to use to compare it to the current date; [today]? Now()?
  2. once that is done, just confirming, that I need to set up a server CRON calling the Internal Action URL?
  3. with this setup will the defined action (sending of an email) happen for each user that fits the criteria or one action for all users?

Another question I have is for other Auto Actions, when sending an email for a change in a user's profile, is there a variable which I can put in the email which resolves to the user who made the change? and another which resolves to frontend or backend? I notice those designations are in the Log file and it would be nice to be able to get them into the email sent.

Thank you,

Louis

Please Log in to join the conversation.

4 years 10 months ago - 4 years 10 months ago #312176 by krileon
Replied by krileon on topic Auto Action use cases

I have set the Conditions to be to compare the Alert Date field to be "less than or Equal to" but I'm unsure what variable to use to compare it to the current date; [today]? Now()?

You'll need to use some format functions to properly compare dates. See the below condition for example.

Field: Custom > Value
Custom Value: [cb:parse function="time"][FIELD_NAME][/cb:parse]
Operator: Greater Than or Equal To
Value: [cb:parse function="time"][cb:date format="Y-m-d" /][/cb:parse]

Be sure to select Format Functions for both Cutom Value and Value. You can review the available formation functions under the Parameters tab. For the date usage see the below substitution tutorial as it can support any PHP date function format.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

This condition should pass if the fields value is greater than or equal to the current date. It's important to convert them to timestamps using the time format function so normal math operators can work.

once that is done, just confirming, that I need to set up a server CRON calling the Internal Action URL?

If you're using the Internal Users trigger and need this to apply to every user, yes. The URL for Internal Users can be found within CB Auto Actions > Parameters. You can also configure the batching behavior there as well.

with this setup will the defined action (sending of an email) happen for each user that fits the criteria or one action for all users?

It will only send for all users that pass whatever conditions you configure.

Another question I have is for other Auto Actions, when sending an email for a change in a user's profile, is there a variable which I can put in the email which resolves to the user who made the change? and another which resolves to frontend or backend? I notice those designations are in the Log file and it would be nice to be able to get them into the email sent.

In CB Auto Actions the substitutions entirely depend on what trigger you're acting on. So for example [username] with onAfterUerUpdate trigger will be the username of the profile that was updated. To force a substitution to be based off the viewing user object you need to use the user="#me" parameter for it. So for example you'd have [cb:userdata field="username" user="#me" /]. This will work with the email field as well to specify in the To parameter if you want. More details regarding this can be found in the substitution tutorial provided above.


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

4 years 10 months ago #312183 by ljalg
Replied by ljalg on topic Auto Action use cases
Kyle,

I think I'm starting to get it, but I started off slow with just trying to add the username of the person who changed the user's record and am having trouble. For a specific Auto Action I have the variable [cb:userdata user="#me" field="username" /] in the email which is to be sent and in the Parameters of that Auto Action being Translate and Substitutions options set to Yes while Format Functions and Content Plugins are set to No. I tried setting the latter two to yes, with no difference, I'm not sure what I'm doing wrong as the email I'm receiving contains the text of the variable "[cb:userdata user="#me" field="username" /]" vs. the username of who made the change.

Excerpt from the email I got is:
This is an automatically generated email from the MPYC.org web site.
Louis's Postal Address was changed by [cb:userdata user="#me" field="username" /]
from: 10 Lilac Street-aa, Monterey, CA 93940
to: 10 Lilac Street, , Monterey, CA 93940

Please let me know if there is another setting I'm missing.

Thank you for your continued support.

Louis

Please Log in to join the conversation.

4 years 10 months ago #312195 by krileon
Replied by krileon on topic Auto Action use cases
Move the user parameter to be after the field.

FROM: [cb:userdata user="#me" field="username" /]
TO: [cb:userdata field="username" user="#me" /]

Some of the parsers have it backwards. cb:if for example expects user to be first. Just an oddity from when this was all originally created.


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

Moderators: beatnantkrileon
Time to create page: 0.227 seconds

Facebook Twitter LinkedIn