joscha / play-easymail

A simple Java wrapper for the Typesafe mailer plugin for Play! Framework 2.x
Other
33 stars 31 forks source link

Can I change the sender for a single email? #14

Closed tistvan closed 10 years ago

tistvan commented 10 years ago

Hello,

Is it possible with this plugin to change the sender of a single e-mail? The other mails on my project will be sent from the address I specified in my application.conf, but the contact e-mail should be sent from a different e-mail address.

Thanks

joscha commented 10 years ago

You can create a custom mailer with a different configuration (see https://github.com/joscha/play-easymail/blob/master/code/app/com/feth/play/module/mail/Mailer.java#L53) - does that suffice?

tistvan commented 10 years ago

Thanks for the quick answer. Can I send e-mail from the currently logged in user's e-mail address?

joscha commented 10 years ago

If you adapt the Configuration object that is being passed, yes, certainly. However maybe the use-case is wide enough to add a senderOverride method - if you send a PR I'd be happy to merge it.

joscha commented 10 years ago

Closing this for now...