How to configure email validation #999
Comments
The same for me. I don't see the way how to configure the validation. |
Same here... this does not seem to be very configurable at all right now? |
I did a little more searching in the code base: I believe it is save to say that the email validation cannot be extended ("configured") like the author of the library intended: https://github.com/egulias/EmailValidator#how-to-extend What you can do is something like this: class MyValidator extends \Egulias\EmailValidator\EmailValidator
{
public function isValid($email, \Egulias\EmailValidator\Validation\EmailValidation $emailValidation)
{
// Ommit the second parameter $emailValidation and do some other magic
return true;
}
}
Swift_DependencyContainer::getInstance()
->register('email.validator')
->asSharedInstanceOf('MyValidator'); I would argue that not the "EmailValidator" but the "EmailValidation" should have been incorporated in the dependency map and the I tinkered with this in my fork https://github.com/madflow/swiftmailer/tree/email_validation and introduced the |
I want to fetch the email from swiftmailer username from the yaml file using ContainerInterface and set it inside |
According to the closed issue #382 it is now possible to configure the email adress ("to" part) validation. However I fail how to do that.
As far as I can see the validation is hardcoded here:
Am I missing something? I understand I can change the validator class by replacing it in the dependency injection - but I do not get how I could configure the validation when doing this.
The text was updated successfully, but these errors were encountered: