/*
 * authservice email/templates.rs
 * - high tech templating system for emails
 *
 * Copyright (C) 2025 Real Microsoft, LLC
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

pub fn gen_verification_code_email(url: &str) -> String {
    format!(r#"thank you for signing up for AskLyphe!
before you can ask lyphe, you must verify your account by opening the link below!
{url}

please note that if your email client has a feature which generates a preview of the link,
your account may already be verified and the url will show an error.
in this case, you can just go ahead and login, hopefully without any further issues!

this issue will be fixed by the end of beta testing.

we won't email you much, but if you don't want us to email you regarding updates to the service that
we consider important, please email devnull@voremicrocomputers.com with your username and we will
opt you out of future announcements.

please note that this email account (no-reply@voremicrocomputers.com) is not checked for received
mail, and all inquiries should be sent to devnull@voremicrocomputers.com

thank you (:
"#)
}

pub fn gen_developer_warning_email(message: &str) -> String {
    format!(r#"hello asklyphe developer!
an error occurred within the authservice which needs attention!
the given message is as follows:
{message}
"#)
}

pub fn gen_announcement_email(contents: &str) -> String {
    format!(r#"{contents}

---
this email was automatically sent because an announcement was posted,
if you would like to not receive these emails in the future, please email us at devnull@voremicrocomputers.com
in the future, you will be able to configure this on your account settings page

we try to keep our email send count as minimal as possible, and we don't want to fill your inbox with spam (:
"#)
}