Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Add ability to customize email subjects #43

Closed
playpauseandstop opened this issue Oct 27, 2012 · 5 comments
Closed

Add ability to customize email subjects #43

playpauseandstop opened this issue Oct 27, 2012 · 5 comments

Comments

@playpauseandstop
Copy link

Right now each email, which send by Flask-Security, has static subject, but in most cases we need to customize email subject due to different applicaiton.

Yeah, it also possible to do in current implementation as:

from flask import Flask
from flask.ext.mail import Mail
from flask.ext.security import Security

app = Flask('appname')
mail = Mail(app)
...
def send_mail(message):
    if message.subject == 'Welcome':
        message.subject = 'Confirm your account'
    mail.send(message)
...
security = Security(app, datastore)
app.extensions['security']._send_mail_task = send_mail

But I think it's ugly ability and more natural way is to adding default subjects similar to default messages and customize they as SUBJECT_WELCOME in project settings.

What do you think?

@mattupstate
Copy link
Collaborator

Thanks for pointing this out. Just something I totally overlooked. I"ll add this feature as soon as I can.

@playpauseandstop
Copy link
Author

Thanks for your response! Will wait for news here :)

@mattupstate
Copy link
Collaborator

Starting work on this in #47

@playpauseandstop
Copy link
Author

Great! Will update to dev version in my project to use this ability!

@mattupstate
Copy link
Collaborator

@playpauseandstop I've released an update with this feature.

TillerBurr pushed a commit to TillerBurr/flask-security that referenced this issue May 28, 2019
* Adds test case for password recovery on deleted user.
  (closes pallets-eco#678)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants