Creating a trigger for auto action

7 years 5 months ago #288407 by timstohr
Creating a trigger for auto action was created by timstohr
Hi Kyle,
I have read up on how to create the triggers etc... and I am fairly confident that I will be able to do it (at the end of the day it only involves copy + paste of CB API calling and then the copy+ paste of the trigger itself.

As far as I have understood, I can make this one myself (eg simply use "onAfterEventsbookingSave" ) and then get it to CB activity. This is where I have a question. Nant mentions that you can send variables, that means for example inside the script that I load the CB API in, I can choose the strings that I want to send to eg CB Activity (calling them var1, var2 etc... according to the order set in the trigger)?

Second question: Assuming I have the commenting stream ready (just like in the gallery commenting), I would like to send an email notification to the event creator that someone commented on their stream. I can guess that I need to send the eventcreatorUserID via the trigger and then send an email notification to the eventCreatorUserID (if email does not work, I am just using this as an example as we have made a system for identifying user-ID to Device-ID and then send push notifications instead of email)

Third question: Instead of commenting, would it be possible to have a whole activity stream? Is that what one can set under the STREAM tab in auto action?

Again, kudos on the product. I love the solution you have created.

Please Log in to join the conversation.

7 years 5 months ago #288423 by krileon
Replied by krileon on topic Creating a trigger for auto action

As far as I have understood, I can make this one myself (eg simply use "onAfterEventsbookingSave" ) and then get it to CB activity. This is where I have a question. Nant mentions that you can send variables, that means for example inside the script that I load the CB API in, I can choose the strings that I want to send to eg CB Activity (calling them var1, var2 etc... according to the order set in the trigger)?

Yes, whatever variables you send you can access with [var1] all the way up to [var10] (it only parses for 10 variables at this time). If the variable is an object you can access that objects public variables using [var1_name], [var1_id], etc..

Second question: Assuming I have the commenting stream ready (just like in the gallery commenting), I would like to send an email notification to the event creator that someone commented on their stream. I can guess that I need to send the eventcreatorUserID via the trigger and then send an email notification to the eventCreatorUserID (if email does not work, I am just using this as an example as we have made a system for identifying user-ID to Device-ID and then send push notifications instead of email)

You would need to do this through the CB Activity trigger after a comment is made. The problem is at this time this trigger doesn't really contain enough information to do this reliably. At least not with an email since you only have access to the source user id and not their email address or object. This is being addressed in CB Activity 4.0.0 where i'll be improving the trigger variables available. However, there is the below ticket and will see if I can get that implemented today, which will allow sending an email with just user id allowing email notification on comment to function.

forge.joomlapolis.com/issues/6320

Third question: Instead of commenting, would it be possible to have a whole activity stream? Is that what one can set under the STREAM tab in auto action?

CB Auto Actions can render an entire custom activity stream or comment stream. Entirely up to you which you want to use, but comment stream sounds like it makes most sense for your usage.


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.204 seconds

Facebook Twitter LinkedIn