
#include "contact.hpp"
#include <format>
#include <unistd.h>

bool Contact::init()
{
	return true;
}

bool Contact::send(const std::string &name, const std::string &email, const std::string &message)
{
	int id = fork();

	if(!id)
	{
		std::string body = std::format("Message: {0} ({1})\n\n{2}", name, email, message);
		execlp("../matrix-commander/venv/bin/python3", "../matrix-commander/venv/bin/python3", "../matrix-commander/matrix_commander/matrix-commander", "-m", body.c_str(), nullptr);
	}

	return true;
}

