getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

Plugin event hook to alter email recipients depending on form values. #66

Closed BootedWeb closed 6 years ago

BootedWeb commented 6 years ago

I have a form which should be sent to different offices, depending on values within the form. The easiest way to do this without duplicating the existing plugin and hacking it, is adding an event hook before https://github.com/getgrav/grav-plugin-email/blob/6e24a6827d53ed0e299cb57ecbfcc9d27ba361bd/email.php#L75 and writing a plugin hooking in on that event, altering the parameters. onEmailSend, for example.

Could you add such an event hook? Or is there another way to achieve the functionality?

rhukster commented 6 years ago

Please submit a PR with the event hook in email plugin and i'll take a lookl

rhukster commented 6 years ago

Merged for next release!