Skip to content

Jcs/mjml20200513#1166

Draft
jSylvestre wants to merge 39 commits into
masterfrom
JCS/Mjml20200513
Draft

Jcs/mjml20200513#1166
jSylvestre wants to merge 39 commits into
masterfrom
JCS/Mjml20200513

Conversation

@jSylvestre

Copy link
Copy Markdown
Member

Don't merge.
This currently just has basic MJML functionality

Introduces `Mjml.Net` to enable the creation of responsive HTML emails using MJML syntax within Razor views.
Includes services for rendering MJML templates and enqueuing the generated HTML emails.
Updates `EnqueueSampleCardEmailAsync` to accept optional `Order` and `User` parameters. This allows MJML-generated emails to leverage contextual data for rendering and better associate with specific domain objects.

Also injects `IMjmlEmailService` into `OrderMessageService`, preparing for future integration of MJML emails for order-related notifications.
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4bf68a67-7a15-4124-af7f-95aaa61af5af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JCS/Mjml20200513

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

jSylvestre added 26 commits June 5, 2026 09:42
Moves specific email templates and their models (e.g., `SampleCard`) into a dedicated `Samples` sub-folder and namespace. Also relocates shared MJML email partials into an `Emails/Shared` folder.

This separation improves the logical grouping of email components, distinguishing generic elements from specific template implementations.
Adds a new MJML-based email to confirm order creation and provide essential information and instructions to the user.
Introduces a new shared footer partial for all MJML emails, including the Anlab logo, contact email, phone number, and address.

This replaces the previous generic text footer and ensures a professional, consistent presentation across all email communications. Also includes minor padding adjustments and removes an unnecessary divider above email buttons.
Introduces a new MJML partial view to display key order information in a structured card. This improves the clarity and readability of the order confirmation email by presenting essential details prominently.
The order confirmation email now prominently displays the total cost of the order in a dedicated section. This ensures recipients can quickly see the final amount.
Unifies the visual presentation of MJML email sections (header, content, footer) into a single, cohesive rounded card. This is achieved by introducing a shared `mj-class` for background color and applying specific border radii to the top and bottom sections.

Also updates email rendering tests to utilize a helper for creating complete order objects, improving test setup.
Introduces default horizontal padding to the shared 'email-card-section' MJML class. This ensures consistent left and right spacing for all card-styled sections, consolidating padding definitions.
Adjusts specific component padding and removes redundant section background colors to ensure consistent application of the unified card styling and standardized horizontal padding. Buttons are now full-width within their sections for improved layout.
This new MJML partial displays individual public tests, their costs, processing fees, and the grand total, offering a clear itemized breakdown for the recipient.
The order confirmation email now displays the AnLab Project Code and Client Provided Id within the order summary card, when available, enhancing the detail provided to the recipient.
Introduces a new card to display any 'Additional Info' provided for the order, enhancing completeness. A 'What's Next?' section is also added, providing clear instructions for the recipient after the order is placed.
Converts card-like sections in email templates from `mj-section`/`mj-column` structures to `mj-table` for improved styling control and more reliable rendering across email clients. This applies to the order summary, additional information, and total amount cards.
Activates the new MJML email service to send order creation confirmations, utilizing the developed templates and infrastructure.
This introduces the model, service method, and template for a new billing agreement request email. It lays the groundwork to replace an existing billing email with the modern MJML service, as indicated by a future TODO.
Includes a dynamic link to the order's reviewer details page, leveraging the current HTTP request context to construct the URL. This allows recipients to directly access the agreement for review.
Refactor the order test details table into a reusable partial view, moving it to the `Shared` email templates folder. This allows consistent display of test details across multiple email types, such as `Order Created` and `Billing Information` emails, reducing code duplication.
The `BillingInformation` email template now uses conditional logic to display different headers and introductory text based on the order's status. This allows the same template to serve as an initial "agreement request" for new or confirmed orders and a "work request billing" notification for finalized orders, providing more accurate context to the recipient.
Previously, the email order test details table only included tests marked as public. This update modifies the filter to also display tests that are flagged specifically for reporting, ensuring these relevant details are visible to recipients even if the test is not publicly available for general ordering.
This improves usability on smaller screens by collapsing less critical columns, such as 'Message Body', into an expandable child row.
This completes the migration of the billing information email to the new MJML email service.
This refactors the order summary card partial view from `Orders` to the `Shared` directory. Renaming it to `_SummaryCard_mjml.cshtml` makes it available for reuse across various email templates.
This introduces a new email sent to clients when their samples have been received by the lab. It provides confirmation, the assigned work request number, lab comments, and potentially updated order and billing details.

To enable content reuse across various email templates, several partials (`_SummaryCard_mjml.cshtml`, `_BillingDetailsCard_mjml.cshtml`, `_AdditionalInfoTextCard_mjml.cshtml`) were refactored to accept an `Order` object directly. The `_OrderCreatedAdditionalInfoCard_mjml.cshtml` partial was also renamed and moved to the shared email views.
The button could cause confusion or access issues for recipients who did not create the order, as they may not have direct access to it.
This change migrates the "Work Request Received By Lab" email to the new MJML email service. It also introduces a bypass mechanism that allows the email to be sent to Anlab staff instead of the client.

When an email is bypassed, its subject is updated to indicate the bypass, and a visible card is included at the top of the email body to clearly inform the recipient that the email was not sent to the intended client. This feature supports internal testing and provides more control over client communications.
Introduces a configurable `UseMjmlEmails` setting that allows switching between the new MJML email service and the legacy Razor-based email templates for order creation, reception, and billing notifications. This enables a phased rollout and provides a fallback mechanism during the MJML migration.
Introduces a new configurable option, `SendEmailRightAway`, which determines if enqueued emails are sent synchronously or saved to the database for later processing. When set to `true`, emails will attempt to send immediately upon being enqueued.

This provides flexibility for real-time notifications or simplifies email testing in development, while maintaining the default asynchronous sending behavior.
Introduces a new email sent to clients when their work request has been completed. This email informs them that results are available, prompts for payment if applicable, and provides details about sample disposition.

The notification leverages the new MJML email service and integrates with the existing email bypass mechanism.

Also, ensures consistent currency formatting using `en-US` culture across relevant MJML email templates.
Introduces a new email sent to clients when partial results for their work request are available. This email includes important order details, lab comments, and a summary of costs.

The notification leverages the new MJML email service and integrates with the existing client email bypass mechanism. When bypassed, the email is sent to Anlab staff for review, indicating it was not sent to the client.
Introduces an optional download link within the "Work Request Partial Results" email, allowing clients to directly access their partial results file.

The inclusion of this link is controlled by the new `IncludePartialResultsDownloadLink` application setting. The link will only appear if the setting is enabled and a results file identifier is present for the order.
Moves inline styling attributes from individual MJML email templates into
named MJML classes defined in the shared layout. This improves consistency
and maintainability of email design.
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.

1 participant