Skip to Content Skip to Menu

Autoactions on file upload not working for new accounts

  • softforge
  • softforge
  • OFFLINE
  • Posts: 129
  • Thanks: 21
  • Karma: 12
7 years 1 month ago #296826 by softforge
In the old file upload one of the options was to email and I am sure you could then get to the file with the link.
But that I am not sure. The issue is that now to get an email if someone adds a file to a profile such as a CV we have to use auto actions.
This works great if the user already had an account but if the if the account is new and we use onafteruserfileupdate so it files when changes happen to the file field, the user id has not yet been created so any link to the file just gives the file name and not the correct url.

Is there any way to allow a link to files that have been added by new users in an email?

Below works if user already created but not if user is new. The Username and Name can be got from the variables but the id is not know until the user creates the account.
<a href=" www.mywebsite.org/about/students/view/ [username]">[name]</a> has updated <a href="[cb_cv]">their CV</a>

Is there another way to wait until the account is created so the id is there but not fire every time an account is created just in case they have not added a file, and of course it has to work if the account was already there byt just the file is updated, which is the bit that works fine at the moment.
Thanks for reading

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
7 years 1 month ago #296831 by krileon
Use onAfterUserRegistration and check that the field isn't empty. onAfterUserFileUpdate does include a saved user object, but only Joomla user object has been saved at that point for new registrations so depending on what you're trying to do it may not be entirely reliable. You maybe able to still use onAfterUserFileUpdate and just access the user object directly using [var1_FIELD_NAME] since var1 for that trigger is the user object. For example change [username] to [var1_username].


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.

  • softforge
  • softforge
  • OFFLINE
  • Posts: 129
  • Thanks: 21
  • Karma: 12
7 years 1 month ago - 7 years 1 month ago #296856 by softforge
Hi Krileon,
thanks for the reply.
I think I was not clear enough. In the example I give
<a href=" www.mywebsite.org/about/students/view/ [username]">[name]</a> has updated <a href="[cb_cv]">their CV</a>
I do say before
"The Username and Name can be got from the variables but the id is not know until the user creates the account."
So they are fine, its the file location, that has the id in and obviously its not created yet. Its this part that does not work
"has updated <a href="[cb_cv]">their CV</a> the link to the file."
It just returns the file name and not the location which would have the user id in it. (which works if updating but not on profile creation)
I agree with your suggestion of onAfterUserRegistration and check that the file is not empty, but what about if someone is just uploading a new file and already had the profile? Thats the part that works but if I add a second action then on creation of profile the client will get 2 emails one which does not link to the file and a second which does. And If I do it all on onAfterUserRegistration the case where its just changed wont happen.

Im pretty sure it used to all work when the email was triggered by the file upload and not extracted out so actions now need to be used.

If you like our plugins, please consider writing a review on the Joomla Extension Directory or the Community Builder Directory ...
Last edit: 7 years 1 month ago by softforge.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
7 years 1 month ago #296858 by krileon

but what about if someone is just uploading a new file and already had the profile?

You'd act on onAfterUserUpdate and check that [var1_FIELD_NAME] Is Not Equal To [var3_FIELD_NAME] to detect a field has changed its value.

Im pretty sure it used to all work when the email was triggered by the file upload and not extracted out so actions now need to be used.

Maybe you're thinking of CB Profile Update Logger and its notification functionality. Beyond that there was never a notification for File fields unless it was something that existed years ago when it was a standalone field plugin.


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