Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditions and segments on date / datetime custom fields. #284

Open
1 task done
iakshay opened this issue Oct 14, 2022 · 6 comments
Open
1 task done

Conditions and segments on date / datetime custom fields. #284

iakshay opened this issue Oct 14, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@iakshay
Copy link

iakshay commented Oct 14, 2022

Mautic Version

4.2.x series

PHP version

7.4

What browsers are you seeing the problem on?

Chrome

What happened?

When using date field in campaigns conditions, it seems like special keywords like Today, Tomorrow do not work. Absolute values like 2022-10-14 do seem to work. I also tried creating a segment with date = Today and doesn't update contacts.

Also, date picker does not work for date fields in campaigns but works fine when creating segment using custom item fields.

How can we reproduce this issue?

  1. Create a custom object say Appointment
  2. Add a custom field of type Date to the object.
  3. Create an custom item of type Appointment with today's date in date picker.
  4. Link custom item to one of the contacts.
  5. Create a campaign that looks like -

image

image

6. Publish the campaign, rebuild and trigger the campaign.

Problem:
Campaign does not send confirmation email for contact with today's appointment. The same campaign works if the comparison is done using = 2022-10-14.

Relevant log output

No response

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct
@iakshay iakshay added the bug Something isn't working label Oct 14, 2022
@iakshay
Copy link
Author

iakshay commented Oct 14, 2022

If this is really a bug, I'm happy to make the change.

Looking at the code, I was hoping adding date operator here might work - https://github.com/acquia/mc-cs-plugin-custom-objects/blob/staging/CustomFieldType/DateType.php#L79

But it doesn't seem to change anything.

@escopecz
Copy link
Contributor

I think that relative dates were not yet implemented for custom field conditions

@escopecz escopecz added enhancement New feature or request and removed bug Something isn't working labels Oct 17, 2022
@iakshay
Copy link
Author

iakshay commented Oct 17, 2022

Thanks @escopecz, would it work for on segments? https://docs.mautic.org/en/contacts/manage-segments#date-options

@escopecz
Copy link
Contributor

I'm not sure. Give it a test.

@iparker
Copy link

iparker commented Nov 10, 2022

Do you have any update for this issue?

I want to try custom objects an have nearly the same use case: I want to have a date in a custom object and send an email relative to this date (for example: 3 days after this date).

Seems that this will not work in the current version?

@iparker
Copy link

iparker commented Apr 2, 2023

Hello,

do you have any news/update for this?

I testet this again with absolute and relative dates and it seems that the segmentation is not working.

In my case I had an custom object with a datetime property.

The custom object had the value "02.04.2023, 08:26:00", the segment the conditions greather than or equal "2023-04-02 00:00" and less than "2023-04-02 23:59".

But the contact which has the custom object is not assigned to the segment.

How can we solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants