Jcs/mjml20200513#1166
Draft
jSylvestre wants to merge 39 commits into
Draft
Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Don't merge.
This currently just has basic MJML functionality