def METHOD_NAME(state):
    """Init app."""
    app = state.app
    # Customise flask-security emails
    security = app.extensions['security']
    @security.send_mail_task
    def send_hepdata_mail(msg):
        send_flask_message_email(msg)
    @security.mail_context_processor
    def security_mail_processor():
        site_url = app.config.get('SITE_URL', 'https://www.hepdata.net')
        return dict(site_url=site_url)
    @app.context_processor
    def set_banner_msg():
        banner_msg = app.config.get('BANNER_MSG', None)
        banner_msg = sanitize_html(banner_msg)
        return dict(banner_msg=banner_msg)