[#7028] CB Auto Actions send email notification on article submission?

6 years 2 months ago #301989 by independentCog
Installed the new one and tested with both and still, no email sent. I have everything set exactly the way it was in my previous screenshots. Changed from auto to self, and tested on auto just in case.

Please Log in to join the conversation.

6 years 2 months ago - 6 years 2 months ago #301999 by krileon
Edit "System - CB Auto Actions" within Extensions > Plugins. Set "Event" to "onAfterInitialise" (may want to try onBeforeRender instead). You should be able to act on that trigger fine now. I've confirmed this works, but looks like the [var1] context isn't what I expected. Instead of com_content.article it's com_content.form. Below seams to work fine.

Global
Triggers: joomla_onContentAfterSave
Type: Email
User: Self
Access: Everybody
Conditions
1: [var1] Equal To com_content.form
Action
To: [user_id]
Body:
Context: [var1]
<br />Article ID: [var2_id]
<br />Article Title: [var2_title]


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.

6 years 2 months ago - 6 years 2 months ago #302022 by independentCog
I got it to work to an extent. When the new System - Auto Actions plugin is enabled the Joomla control panel gives off an error and goes to white screen. All other parts of the site are functional aside from Control Panel.

The error is: Error: Argument 1 passed to cbPluginHandler::_getPluginParamsFromTable() must be an instance of CB\Database\Table\PluginTable, instance of stdClass given, called in [dir]cbPluginHandler.php on line 704: Argument 1 passed to cbPluginHandler::_getPluginParamsFromTable() must be an instance of CB\Database\Table\PluginTable, instance of stdClass given, called in [dir]cbPluginHandler.php on line 704

[dir] is the file path that leads to that which I took out.

Doesn't get in the way of any site functionality as far as I can see but I haven't tested everything yet.
Also with this, I'm trying to handle it in the conditions so that when a specific category has an article made the email is sent to a specific user.
The condition: [var2_id] Equal to [number of category] didn't work because I realized after the email that associated with the article number. Is there any way to condition the category id instead?

One last thing I noticed when using [user_id] in the To: part of the Action all the body is shown.
When I just put the actual email (email@place.com) the article title no longer is output to the email. Potentially a small thing but just trying to convey every detail I'm seeing related to this.

As it stands now based on your example it sends an email whenever any article is created and not when an article is created in a specific category.

Please Log in to join the conversation.

6 years 2 months ago #302035 by krileon

I got it to work to an extent. When the new System - Auto Actions plugin is enabled the Joomla control panel gives off an error and goes to white screen. All other parts of the site are functional aside from Control Panel.

There certainly shouldn't be an error and am not seeing one here in my tests. Try using onBeforeRender event to see if the auto action still works without causing an error. That's kinda the dangers of loading it too early.

The condition: [var2_id] Equal to [number of category] didn't work because I realized after the email that associated with the article number. Is there any way to condition the category id instead?

[var2] is the Joomla article object. So [var2_id] is the article id, which you can't know yet since you're creating a new article. If you need to condition against category it's probably [var2_catid].

One last thing I noticed when using [user_id] in the To: part of the Action all the body is shown.
When I just put the actual email (email@place.com) the article title no longer is output to the email. Potentially a small thing but just trying to convey every detail I'm seeing related to this.

The To has no affect on the Body. Using a user id simply grabs that users email address and places it in the To. I'm unsure why you're having so many odd issues. My above exact example was tested and confirmed working. Please ensure everything installed is completely up to date.


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.

6 years 2 months ago #302065 by independentCog
Everything is up to date. onBeforeRender stops the error but then the email doesn't send. Based on the error it seems to be a conflict with the cb plugin listing on the Control Panel. I tested and email sends fine with onAfterInitialize.

Is there a listing of the variables like [var2_id], [var2_catid], etc. Where can I find these for future reference as I expand on what I can do with this?

Please Log in to join the conversation.

6 years 2 months ago - 6 years 2 months ago #302079 by krileon

Based on the error it seems to be a conflict with the cb plugin listing on the Control Panel. I tested and email sends fine with onAfterInitialize.

Was able to confirm on the control panel page. Oddly doesn't seam to happen anywhere else. It's likely I won't be able to fix this though as it's probably a result of loading too early, but will see if it's fixable.

forge.joomlapolis.com/issues/7034

You maybe able to try the other Events available (e.g. onAfterRoute) to see if they work without erroring.

Is there a listing of the variables like [var2_id], [var2_catid], etc. Where can I find these for future reference as I expand on what I can do with this?

They're entirely subjective to what trigger is used. CB Auto Actions will parse up to 15 variables sent to it. For CB triggers you can use the below list to check the available variables.

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

For Joomla events you'll need to refer to Joomla documentation. var2 of that trigger though is the article object, which is a content object stored in _content database.


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

Facebook Twitter LinkedIn