Skip to content

How to use EmailDevice subclass with email plugin? #747

@ebeers-png

Description

@ebeers-png

I'm using django-otp and django-two-factor-auth for MFA through email. I want to customize the send_mail method in django-otp's EmailDevice model to use my own custom email code, and keep everything else the same. But I've tried subclassing EmailDevice both with a regular model and a proxy model, and in both cases django-two-factor-auth's email plugin doesn't use my send_mail method.

Is there a way to override send_mail and get it to work with django-two-factor-auth's email plugin? The only alternative I can think of is to fork either django-otp or django-two-factor-auth and change the code to what I need, but is there a simpler way I haven't thought of?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions