yii2-usuario
yii2-usuario copied to clipboard
Send a completely different welcome mail
Hello! Is there any way not to send a default welcome email and send my own email in overrode RegisterController? Can't find an option. In fact, I only need to change a layout and html of welcome email, but without touching other emails (recovery etc).
Thank you.
Did you try overriding views?
Did you try overriding views?
Yes, thank you, I know about this possibility, but then I will override all other emails as well, what is not needed. But if this is the only option, I would use it, of course.
No, you can just override the ones you need. The not found ones will be fetched from the original source
No, you can just override the ones you need. The not found ones will be fetched from the original source
I understand this, but I'm talking about layouts, not only about emails :) can I use a different layout only for the welcome email?
Really, I'd rather switch off sending default welcome email, and send my own using event 'after registration'. Because as I see, there is even no opportunity to embed images in MailFactory, is it?
https://yii2-usuario.readthedocs.io/en/latest/installation/configuration-options/#enableemailconfirmation-type-boolean-default-true
A very useful option, but it only regulates including or not a confirmation link in welcome mail body.
Anyway, thank you for your help. I decided to copy-paste RegistrationController->actionRegister() and override a MailFactory method makeWelcomeMailerService(). A bad coding style, but can imagine nothing better :(
dead link
Working link: https://yii2-usuario.readthedocs.io/en/latest/install/configuration-options/#enableemailconfirmation-type-boolean-default-true