Skip to Content Skip to Menu

AutoActions - onAfterUserFileUpdate

6 years 10 months ago #300930 by philiplardner
AutoActions - onAfterUserFileUpdate was created by philiplardner
Hi,

When I first installed AutoActions a couple of years ago I was able to set up an autoaction to send the administrator an email every time a user updated any one of several file fields in their profile. The AutoAction email included the username, the name of the file being uploaded and the cb_fieldname being updated. The email would also include a copy of the file being uploaded as an attachment.

The Action email body was formatted as follows:

[firstname] [lastname] ([username] [user_id]) has uploaded <file> to [field].

NB: The word <file> above should be in square brackets but this seems to mess up the formatting of this message!

Example:

Subject: Joe Bloggs uploaded a file - ACTION REQUIRED!
Date: Thu, 28 Jul 2016 12:42:12 +0000
From: xxxx <website@xxxx.ie>
To: website@xxxx.ie

joebloggs (424) has uploaded Insurance_20160720170500579_5799fda3e364b.pdf to cb_insurancedocument.

OR

joebloggs (424) has uploaded Waiver_57a4670d3d91c.jpg to cb_waiverdocument.


After installing the latest release of AutoActions I am no longer seeing either the name of the file being uploaded or the name of the cb_field it is being uploaded to, and the file is no longer being sent as an attachment to the notification email.

How do I restore this functionality?

Thanks,

Philip.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 10 months ago - 6 years 10 months ago #300945 by krileon
Replied by krileon on topic AutoActions - onAfterUserFileUpdate
You don't have an active subscription so how could you have the latest CB Auto Actions? If you've a separate account with latest purchased please post in the support forums from that account. Please be sure to include details regarding your auto action when posting in the support forums.


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: 6 years 10 months ago by krileon.

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

6 years 10 months ago #300950 by philiplardner
Replied by philiplardner on topic AutoActions - onAfterUserFileUpdate
Let me rephrase that - I updated to the latest version of AutoActions (6.3.7+build.2017.05.20.16.13.59.7982aec9c) shortly before my Developer subscription expired. I can't justify spending €360 renewing my subscription for the amount of use I make of it for the non-profit club website I maintain.

Any help would be appreciated.

Thanks,

Philip.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 10 months ago - 6 years 10 months ago #300982 by krileon
Replied by krileon on topic AutoActions - onAfterUserFileUpdate
The latest release is 7.1.0+build.2018.01.09.19.07.21.48a198cd8. You're several versions behind. With that said I suggest reviewing your auto action carefully as new parameters have been added throughout the releases as could be a configuration issue. I don't know what version you had prior to 6.3.7+build.2017.05.20.16.13.59.7982aec9c nor would I recall what has changed between those 2 releases that might cause you issues.

Is it just those 2 fields not substituting right? Does [username] for example still substitute fine?


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: 6 years 10 months ago by krileon.

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

6 years 10 months ago #300989 by philiplardner
Replied by philiplardner on topic AutoActions - onAfterUserFileUpdate
Yes, it's just <file> and [field] that are not substituting.

[firstname], [lastname], [username] and [userid] all substitute correctly.

I in the version of AutoActions I have installed, I see a field for including attachments to the email. How do I get it to automatically attach the file or files that the user has just uploaded. Is it as simple as entering 'file' (in square brackets) in the attachment field?

Thanks,

Philip.

AutoAction Type: Email
AutoAction Trigger: onAfterFileUpdate
AutoAction Email Body: [firstname] [lastname] ([username] [user_id]) has uploaded <file> to [field].
NB: The word <file> above should be in square brackets but this seems to mess up the formatting of this message!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
6 years 10 months ago - 6 years 10 months ago #300996 by krileon
Replied by krileon on topic AutoActions - onAfterUserFileUpdate
There is no <file> (with brackets) substitution nor is there a [field] substitution (unless you meant this as [FIELD_NAME]). I don't see how either of those possibly ever worked as no such substitutions exist. To substitute in a field you need to use [FIELD_NAME] for the raw value and [cb:userfield field="FIELD_NAME" /] for the formatted value. In the case of a file field using [FIELD_NAME] will give you the URL to download the file. So for example my file fields name is cb_file I'd use [cb_file]. If you need the raw filename on that trigger you'd need to use [var2], which is $newFileName from that trigger.

The attachments work by attaching a file from its absolute URL starting at server root. So you'd need the full absolute path to the file for that to work. Personally wouldn't recommend doing this as it just makes the email larger. The download URL should be sufficient if you want to download it directly.

I suggest the below for the email body.

Code:
[firstname] [lastname] ([username] [user_id]) has uploaded <a href="[FIELD_NAME]">[var2]</a> to FIELD_NAME.

See the below tutorial for further substitution usage information.

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


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: 6 years 10 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum