Skip to Content Skip to Menu

🏖 Summer has arrived! Start your summer right with our summer sale! Get 25% off professional and developer memberships with code SUMMER-2025!

CB Auto actions - auto mail

9 years 5 months ago #278656 by MaartenV87
Replied by MaartenV87 on topic CB Auto actions - auto mail
What variable shoulld I use to get the currentdate?

Basicly I want to achieve the following:
Trigger
Users

Type
Field

Conditionals
[cb_mydate] (with value 2016-02-03 from a date field)
is less then
the current date (don't know the according variable)


Action
Change field value

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 49427
  • Thanks: 8463
  • Karma: 1465
9 years 5 months ago #278672 by krileon
Replied by krileon on topic CB Auto actions - auto mail
For dates to compare they need to be turned into timestamps. The below should work.


Value: [cb:parse function="time"][cb_mydate][/cb:parse]
Operator: Less Than
Value: [cb:parse function="time"][cb:date format="Y-m-d H:i:s" /][/cb:parse]


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.

9 years 5 months ago #279082 by MaartenV87
Replied by MaartenV87 on topic CB Auto actions - auto mail
Thanks. If I place the conditions like this, does it places an AND function between this?
If the field is not empty AND the value is less then todays date do the action.
Or how can I filter out empty values because now I have the feeling the action also triggers users with fieldvalue 0000-00-00

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 49427
  • Thanks: 8463
  • Karma: 1465
9 years 5 months ago #279111 by krileon
Replied by krileon on topic CB Auto actions - auto mail
To check against empty value use the following usage.

Date Fieldtype:
[cb_mydate] Not Equal To 0000-00-00

Datetime Fieldtype:
[cb_mydate] Not Equal To 0000-00-00 00:00:00

Don't run time conversion on it as strtotime gives weird results for those values. You may need to have a 3rd condition as follows.

[cb_mydate] Not Empty


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.

9 years 4 months ago - 9 years 4 months ago #279820 by MaartenV87
Replied by MaartenV87 on topic CB Auto actions - auto mail
Thanks, this seems to work.

I noticed you can use time parameters in conditions.

Value: [cb:parse function="time"][lastvisitdate][/cb:parse]
Operator: Less Than or Equal To
Value: [cb:parse function="time" time="-20 DAY"][cb:date format="Y-m-d H:i:s" /][/cb:parse]

Is this a correct way to mail users after inactivity of 20 days?
Last edit: 9 years 4 months ago by MaartenV87.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 49427
  • Thanks: 8463
  • Karma: 1465
9 years 4 months ago #279838 by krileon
Replied by krileon on topic CB Auto actions - auto mail
Yes, that looks correct. That should pass if they haven't logged in within the past 20 days.


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