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

Fix #9907 - Workflow - Email action doesn't parse datetime field format and timezone correctly #9908

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

SinergiaCRM
Copy link
Contributor

Description

This PR adds the code to parse date and datetime correctly when sending workflow action emails after modifying a record.

Motivation and Context

With this change the date and datetime fields will be always received in user format and timezone

How To Test This

  1. Create a Datetime Field in Contacts module
  2. Create an Action that send an email to a modified Contact. Add the Datetime field in the email
  3. Create a Contact filling the Datetime field
  4. Modify the Contact record to make the Workflow run and receive the email
  5. Check that the email has the right datetime value format and timezone

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@serhiisamko091184 serhiisamko091184 added Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Branch:Hotfix Status: Requires Code Review Needs the core team to code review labels Jan 24, 2023
@clemente-raposo
Copy link
Contributor

clemente-raposo commented Feb 1, 2023

Hi @SinergiaCRM,

Thank you for your PR.

From what I understand this will use the $current_user as the base for getting the date time format.

What will happen if the emails is sent during a cron job? It will probably use db format or system format right?

Copy link
Contributor

@johnM2401 johnM2401 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Checked each of the Date & Time formats in User Profile, all seemed to send as expected

@clemente-raposo clemente-raposo added Status:In Review Pull Requests that are activity being reviewed by the core team Status:Requires Updates Issues & PRs which requires input or update from the author labels Feb 15, 2023
@gemartin21 gemartin21 added Area: Workflow Issues & PRs related to all things regarding workflow and removed Status: Requires Code Review Needs the core team to code review labels Feb 28, 2023
@SinergiaCRM
Copy link
Contributor Author

Hi @SinergiaCRM,

Thank you for your PR.

From what I understand this will use the $current_user as the base for getting the date time format.

What will happen if the emails is sent during a cron job? It will probably use db format or system format right?

Hi @clemente-raposo ,

If the emails are sent during cron job I believe the current_user will be used, that could be either the FdT assigned_user or the Scheduler assigned_user.

For us it's working fine til now.

@serhiisamko091184 serhiisamko091184 added Status: Requires Code Review Needs the core team to code review and removed Status:Requires Updates Issues & PRs which requires input or update from the author labels May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Workflow Issues & PRs related to all things regarding workflow Branch:Hotfix Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status:In Review Pull Requests that are activity being reviewed by the core team Status: Requires Code Review Needs the core team to code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflow - Email action doesn't parse datetime field format and timezone correctly
5 participants