Flask application initialization.

        The initialization will:

         * Set default values for the configuration variables.
         * Initialise the Flask mail extension.
         * Configure the extension to avoid the email sending in case of debug
           or ``MAIL_SUPPRESS_SEND`` config variable set. In this case, the
           email will be written in the stream configured in the extension.

        :param app: Flask application object.

def init_app(self, app):
        """Flask application initialization.

        The initialization will:

         * Set default values for the configuration variables.
         * Initialise the Flask mail extension.
         * Configure the extension to avoid the email sending in case of debug
           or ``MAIL_SUPPRESS_SEND`` config variable set. In this case, the
           email will be written in the stream configured in the extension.

        :param app: Flask application object.
        """
        self.init_config(app)
        if 'mail' not in app.extensions:
            Mail(app)
        if app.config.get('MAIL_SUPPRESS_SEND', False) or app.debug:
            email_dispatched.connect(print_email)
        app.extensions['invenio-mail'] = self