scheb / 2fa

Two-factor authentication for Symfony applications 🔐
MIT License
495 stars 72 forks source link

Add subject_email parameter #187

Closed sdespont closed 1 year ago

sdespont commented 1 year ago

This PR brings the possibility to define the subject of the mail sent with the authentication code. The parameter subject_email have been added, with a default value equals to the actual text "Authentication Code"

sdespont commented 1 year ago

@scheb what do you think about having a configurable prefix text before the code in the email? I don't want to spend time to push a PR if you don't agree with this approach

scheb commented 1 year ago

Hmm, wouldn't want to add more configuration options. I'm not having the intention to provide the ultimate configurable mailer with the bundle.

Way to go would rather be to implement a custom mailer, which generates the email exactly as you want it. The on-board mailer is just doing the bare minimum to have something working.

sdespont commented 1 year ago

@scheb you are right, implement a custom mailer is easy https://symfony.com/bundles/SchebTwoFactorBundle/current/providers/email.html#custom-mailer

After reflection, suffix or prefix is not a good idea. But permitting to set the email subject of the default email still makes sense for me.

scheb commented 1 year ago

There seem a whole lot of changes in the diff, that aren't related to this merge request. In its current form I cannot merge it, as it will mess things up.

If you want to proceed, please review the diff and provide a cleaned-up changeset that just contains your changes.

scheb commented 1 year ago

Closing due to inactivity. If you feel like follow-up on this, please create another PR. Thank you!