Skip to content

Event "SendMailServicePrepareAndSendEvent": Not possible to change message object as stated in documentation #1236

@tntrpsw

Description

@tntrpsw

In the powermail documentation the event "SendMailServicePrepareAndSendEvent" ist described as

Change the message object before sending

But trying to use this event in order to change the email's subject seems not to be possible.

After taking a look in the powermail sources, it seems that no data from the event object other than "isAllowedToSend()" ist evaluated or used for the actual sending of the email. So using this event to (as advertised) "Change the message object before sending" is not possible.

So, would it be possible to change powermail's prepareAndSend() function to create the advertised functionality? Maybe my adding a

$message = $event->getMailMessage();
$email = $event->getEmail();

just before calling $message->send(); ?

TYPO3 12.4.26 (legacy; no composer)
powermail 12.5.1

powermail's event description:
Location:In2code\Powermail\Domain\Service\Mail\SendMailService::prepareAndSend()
Event: In2code\Powermail\Events\SendMailServicePrepareAndSendEvent
escription: Change the message object before sending

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions