Skip to content

FOUR-9229 Review email-connect, to avoid the launch of a docker instance to send an simple email#4991

Merged
caleeli merged 6 commits into
FOUR-8177from
FOUR-9229
Jul 13, 2023
Merged

FOUR-9229 Review email-connect, to avoid the launch of a docker instance to send an simple email#4991
caleeli merged 6 commits into
FOUR-8177from
FOUR-9229

Conversation

@caleeli
Copy link
Copy Markdown
Contributor

@caleeli caleeli commented Jul 12, 2023

Issue & Reproduction Steps

Bring up a docker ssr to render a html template is a bit overkill, so as a developer I want to use a simple php renderer with mustache and date time format support.

Expected behavior:

Add HtmlRenderer class with mustache and date format

Solution

  • Implement a HtmlRenderer class with mustache and date format support.

How to Test

  • Create a process with date and datetime fields and with connector email (e.g. attached process)
  • Run the process
  • Check the variables are replaced in the email body and the date and time are formatted as the system configuration.

Test_EmailConnector.zip

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

@caleeli caleeli requested a review from julceslauhub July 12, 2023 20:32
@caleeli caleeli changed the base branch from develop to FOUR-8177 July 12, 2023 20:32
@processmaker-sonarqube
Copy link
Copy Markdown

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.0% 0.0% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

$token->setProperty('error', $error);

// Log message errors
error_log('Service task failed: ' . $implementation . ' - ' . $exception->getMessage());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove this line, in the next line is logged the same error...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

use ProcessMaker\Models\EnvironmentVariable;
use ProcessMaker\Models\Process as Definitions;
use ProcessMaker\Models\Process;
use ProcessMaker\Models\Process as Definitions;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this reference is not used in this file...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Definitions is used as alias of Process. I removed the use ProcessMaker\Models\Process; and use Definitions to keep the logic of the class

Copy link
Copy Markdown
Contributor

@julceslauhub julceslauhub left a comment

Choose a reason for hiding this comment

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

Approved

@caleeli caleeli merged commit cf70537 into FOUR-8177 Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants