Hi,
I would like to suggest an additional Event that gets fired right before mail is finally sent:
protected function sendFormEmail($form, $params, $vars)
{
//code before
$this->grav->fireEvent('onBeforeFinalEmailSend', new Event(['message' => $message]));
// Send e-mail
$this->email->send($message);
}
Reason: I had to encrypt form data send through email. It's possible to use OpenPGP with Swiftmailer through Nightjar's SwiftSigner-CryptGPG, but the signer needs to be applied to the message object. I know it's a very rare use case, because openpgp needs to be installed serverside and apache/nginx/php-fpm user needs an valid keyring and so on, but it's a very small change ;)
I guess through a few modifications it's also possible to sign mails - maybe this is a more common use case.
// EDIT: I already "wrote" a plugin implementing NightJar's SwiftSigner - I also like to provide it to the grav community if there is an Event Hook - otherwise my plugin is not very "plugable" ;)
Hi, I would like to suggest an additional Event that gets fired right before mail is finally sent:
Reason: I had to encrypt form data send through email. It's possible to use OpenPGP with Swiftmailer through Nightjar's SwiftSigner-CryptGPG, but the signer needs to be applied to the message object. I know it's a very rare use case, because openpgp needs to be installed serverside and apache/nginx/php-fpm user needs an valid keyring and so on, but it's a very small change ;) I guess through a few modifications it's also possible to sign mails - maybe this is a more common use case.
// EDIT: I already "wrote" a plugin implementing NightJar's SwiftSigner - I also like to provide it to the grav community if there is an Event Hook - otherwise my plugin is not very "plugable" ;)
thanks.