Add the ability to send an email with a LinkedResource #17863
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.
This pull request adds support for linked resources in the
EmailMessage
model. It also updates theToMimeMessage
method to handle these linked resources, ensuring they are properly included in email messages. A new constructor is introduced to maintain backward compatibility.Changes:
Updated the
EmailMessage
class:LinkedResources
of typeIList<EmailMessageLinkedResource>
.HasLinkedResources
for checking linked resource presence.Added a new
EmailMessageLinkedResource
class:Updated the
ToMimeMessage
extension method:LinkedResources
when converting toMimeMessage
.Testing Steps:
Unit Test for Backward Compatibility:
EmailMessage
object using the old constructor (withoutLinkedResources
).LinkedResources
property isnull
.ToMimeMessage
method works as expected, without errors.Unit Test for New Functionality:
EmailMessage
object using the new constructor, includingLinkedResources
:ToMimeMessage
method includes the linked resource with the correctContentId
.Edge Cases:
LinkedResources
to ensure no exceptions occur.LinkedResources
collection and ensure only valid resources are included.Integration Testing:
EmailMessage
model in an actual email-sending flow.Code Review:
Expected Results:
ContentId
.