Skip to Content Skip to Menu

[SOLVED] Triggering an email message based on a field change status

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 2 months ago - 4 years 2 months ago #320473 by eciudad
I have a comprofiler field that stores emails which are entered during the registration (additionally to the registrant email). The goal is that when the profile is saved, to sent a message to that that email. I Would like to do this every time the email changes. Could this be done in auto actions or or is there any other function that could do this? Thank you.

Thank you in advance.
Last edit: 4 years 2 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
4 years 2 months ago #320476 by krileon
Yup that can be done with CB Auto Actions. See the below regarding the initial setup. Note the below can work with any action type to perform something when a field value changes and in your case use Email action type.

Global
Triggers: onAfterUserUpdate, onAfterUpdateUser
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_FIELD_NAME]
Operator: Not Equal To
Value: [var3_FIELD_NAME]

This compares the new value in var1 with the old value in var3 to see if the field changed values. If you also want to make sure the field even has a value then add the below condition as well.

Field: Custom > Value
Custom Value: [var1_FIELD_NAME]
Operator: Not Empty

Be sure to change FIELD_NAME to the actual name of your field.


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

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

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 2 months ago #320511 by eciudad
Will try. Thank you for the information Kyle!

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

  • eciudad
  • eciudad
  • OFFLINE
  • Posts: 209
  • Thanks: 19
  • Karma: 0
4 years 2 months ago #320529 by eciudad
It does work great. Thank you!
The following user(s) said Thank You: krileon

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

  • bascherz
  • bascherz
  • OFFLINE
  • Posts: 228
  • Thanks: 29
  • Karma: 11
3 years 11 months ago #322017 by bascherz
I've got an auto action setup exactly like this with var1 vs var3 compares on several fields:
  • cb_mobile
  • cb_phone
  • cb_zip
  • email

The idea is to have an email sent when any of the above change. Problem is, I am getting an email when this profile is saved, even if nothing changed.

Yes, I have checked to make sure all the fields are spelled correctly. But I was wondering if [var1_email] and [var3_email] work the same as the comprofiler fields in this regard. I haven't started the process of elimination part yet. Figured I'd ask here first.

Thanks in advance.

Bruce S - Vienna, VA

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48548
  • Thanks: 8290
  • Karma: 1445
3 years 11 months ago #322018 by krileon
When acting on onAfterUserUpdate or onAfterUpdateUser for field value changes you need to compare the var1 value against the var3 value. That's basically it as instructed in my reply above. It's not possible for CB Auto Actions to send an email if those conditions are not met. Maybe you're using OR conditions and not AND conditions if you've multiple conditions?


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