v0.10.302 #2

Merged
didirus merged 289 commits from feature-clean into beta 2025-07-08 15:00:09 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit 9dc5644264 - Show all commits

View File

@@ -85,6 +85,8 @@ TREMENDOUS_CAMPAIGN_ID=none
HCAPTCHA_SECRET=none
SMTP_FROM_NAME=Modrinth
SMTP_FROM_ADDRESS=no-reply@mail.modrinth.com
SMTP_USERNAME=none
SMTP_PASSWORD=none
SMTP_HOST=none

View File

@@ -2,7 +2,7 @@ use lettre::message::Mailbox;
use lettre::message::header::ContentType;
use lettre::transport::smtp::authentication::Credentials;
use lettre::transport::smtp::client::{Tls, TlsParameters};
use lettre::{Address, Message, SmtpTransport, Transport};
use lettre::{Message, SmtpTransport, Transport};
use thiserror::Error;
use tracing::warn;
@@ -23,11 +23,13 @@ pub fn send_email_raw(
subject: String,
body: String,
) -> Result<(), MailError> {
let from_name = dotenvy::var("SMTP_FROM_NAME")
.unwrap_or_else(|_| "Modrinth".to_string());
let from_address = dotenvy::var("SMTP_FROM_ADDRESS")
.unwrap_or_else(|_| "no-reply@mail.modrinth.com".to_string());
let email = Message::builder()
.from(Mailbox::new(
Some("Modrinth".to_string()),
Address::new("no-reply", "mail.modrinth.com")?,
))
.from(Mailbox::new(Some(from_name), from_address.parse()?))
.to(to.parse()?)
.subject(subject)
.header(ContentType::TEXT_HTML)