Add method to retrieve sent mail string

Created on 21 March 2023, over 1 year ago
Updated 22 March 2023, over 1 year ago

Problem/Motivation

While implementing the requirement of saving outgoing mails into an imap account, we found that there currently is no way to extract the actual mail string.

Proposed resolution

Add \Drupal\symfony_mailer\BaseEmailTrait::toString with a validation check for post sending. This method calls the \Symfony\Component\Mime\Email::toString on $this->inner.

Remaining tasks

Review and commit MR.

✨ Feature request
Status

Needs work

Version

1.2

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria attisan Vienna

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @attisan
  • @attisan opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡¦πŸ‡ΉAustria attisan Vienna
  • Status changed to Needs work over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom AdamPS

    Thanks for the issue and patch.

    1. This needs a change to BaseEmailInterface, then can have an {@inheritdoc} comment on the Trait.
    2. In the comments, please say "email" rather than "mail" (2 places).
    3. This module has a problem that the tests are a long way behind, see #3278446: Add more tests β†’ . I'd like all new features to include test coverage so the gap doesn't continue to get bigger. Please could you create a new test EmailFunctionTest which aims to test every function on EmailInterface? You don't have to test them all (although please feel free toπŸ˜ƒ), at least test your new function.
Production build 0.69.0 2024