Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Too many emails are sent with AutoActions & Ajax

  • peli_m
  • peli_m
  • OFFLINE
  • Posts: 54
  • Thanks: 6
  • Karma: 0
8 years 5 months ago - 8 years 5 months ago #281305 by peli_m
Hello,

I have 2 fields: transport (radiobuttons) and roommates (text area), both with Ajax editing in frontend active and working fine.

I have created two Auto Actions with Type: Email and trigger OnAfterUserUpdate:

1.- When the user changes their transport method, an email must be sent to the email address of the transport coordinator.

2.- When the user introduce data in roommates, an email must be sent to the email address of roommates coordinator.

Both actions are working, but when you modify one of the fields, both emails are sent simultaneously.

Edit: Really the emails are sent when any other field is modified with Ajax in frontend.

How can I fix this?

Thank you.
Jose
Last edit: 8 years 5 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago - 8 years 5 months ago #281341 by krileon
You need to make sure the field was actually changed. That trigger fires when the profile updates exactly as it implies. It does not fire for a single specific field. So any profile change will fire it. To condition to make sure the field has actually changed values you need to use the below conditions.

1: [var1_FIELD_NAME] Is Not Empty
2: [var1_FIELD_NAME] Not Equal To [var3_FIELD_NAME]

var1 is the updated user object while var3 is the old user object. It's making sure they didn't save the field to empty and that compared to the previous value the field has actually changed.


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: 8 years 5 months ago by krileon.

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

  • peli_m
  • peli_m
  • OFFLINE
  • Posts: 54
  • Thanks: 6
  • Karma: 0
8 years 5 months ago #281358 by peli_m
Thank for your fast answer. I need to change conditions var2 as var3 and it works fine!

Thank you very much

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago #281359 by krileon
Yup, corrected my reply. Forgot that trigger is a bit of an oddball and has the old object as var3. At some point var2 will become the old object with var3 being deprecated eventually.


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

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

Moderators: beatnantkrileon
Powered by Kunena Forum