-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support both Text & HTML in the same email #14715
base: main
Are you sure you want to change the base?
Conversation
@Mike4tel could you please try to send via |
@hishamco Html - OK |
All or Both make sense to me
This will revert the changes and let the body |
@sebastienros are we fine to add two bodies into the One option if we use |
Just pointing out that only stripping html will not let users format text nicely for plain text.. it is needed for good marketing. But I can see using stripped html version as another feature just to fight spam filters. |
Is it possible to merge this one? :) |
We forgot this one :) I will do a final review and then merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hishamco what is the problem that you are trying to solve? Why would we need All
as an enum value?
Maybe we should have an interface for the message like INotificationMessage
which we already have. Or something similar
public interface IEmailMessage
{
string Message { get; }
bool IsHtml { get; }
}
I don't think so, the issue was the email can be sent in both formats. In the past we already had |
This pull request has merge conflicts. Please resolve those before requesting a review. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
# Conflicts: # src/OrchardCore.Modules/OrchardCore.Email/Controllers/AdminController.cs # src/OrchardCore.Modules/OrchardCore.Users/Controllers/EmailAuthenticatorController.cs # src/OrchardCore/OrchardCore.Email.Core/Services/SmtpService.cs
@MikeKry could please do one more test, this PR takes so long, we need to review it and merge it ASAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There needs to be some kind of migration for existing email tasks. Currently, any existing email body is lost when I edit an existing mail task.
mode: { name: "liquid" }, | ||
}); | ||
|
||
$('select').onchange(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me either. Shouldn't this be like on('change,...)
?
Additionally, I think the select
element needs its own id.
Let me check |
I might not work extensively on workflow, I'm not sure how we can achieve that, feel free to add a commit in the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still many issues at the moment in this PR. E.g. the UI is broken in the workflow editor, because the state of the selected body types is not restored. Also the code mirror editors are not working correctly, if they are initialized on a hidden input field.
src/OrchardCore.Modules/OrchardCore.Email/Views/Items/EmailTask.Fields.Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Email/Views/Items/EmailTask.Fields.Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Email/Workflows/Activities/EmailTask.cs
Outdated
Show resolved
Hide resolved
…k.Fields.Edit.cshtml Co-authored-by: Georg von Kries <gvk@creativbox.net>
…k.Fields.Edit.cshtml Co-authored-by: Georg von Kries <gvk@creativbox.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is much simpler and better now.
But I still have the issue with the workflow task editor, where switching between HTML and Text only is not working correctly. I suggest that we just show both editors all the time and skip having to select between text/html/all.
Co-authored-by: Georg von Kries <gvk@creativbox.net>
I will revise the workflow one more time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow editor should provide two tabs or fields (with one collapsed by default?) for users to provide both values at all times. Either they provide 0, 1 or 2 contents then we just flow these values to the BodyMessage. We can pass null
in the html/text argument if the text is empty (but not whitespace).
/// <param name="body">The email body.</param> | ||
/// <param name="isHtmlBody">Whether the <paramref name="body"/> is in HTML format or not. Defaults to <c>true</c>.</param> | ||
/// <returns></returns> | ||
/// <param name="htmlBody">The email body in HTML format.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments should say the values are optional (can be null). Maybe use the ?
operator to be specific.
The current implementation allows the user to either use HTML or Text or both EmailTask.mp4 |
@gvkries please check the above video |
@hishamco As said:
|
/cc @MikeKry