def _run_action(self, action_parameters):
        """
        Run action with the provided action parameters, return status output and
        parse the output email data.
        """
        models = self.fixtures_loader.load_models(
            fixtures_pack=FIXTURE_PACK, fixtures_dict={"actions": ["sendmail.yaml"]}
        )
        action_db = models["actions"]["sendmail.yaml"]
        entry_point = self.fixtures_loader.get_fixture_file_path_abs(
            FIXTURE_PACK, "actions", "send_mail/send_mail"
        )

        runner = self._get_runner(action_db, entry_point=entry_point)
        runner.pre_run()
        status, result, _ = runner.run(action_parameters)
        runner.post_run(status, result)

        # Remove footer added by the action which is not part of raw email data and parse
        # the message
        if "stdout" in result:
            email_data = result["stdout"]
            email_data = email_data.split("\n")[:-2]
            email_data = "\n".join(email_data)
            message = mailparser.parse_from_string(email_data)
        else:
            email_data = None
            message = None

        return (status, result, email_data, message)

        Run action with the provided action parameters, return status output and
        parse the output email data.
        
contrib/core/tests/test_action_sendmail.py