mirror of
https://github.com/rustmailer/rustmailer.git
synced 2026-09-05 08:01:06 +00:00
feat(email): add thread_id field to EmailAddedToFolder
This commit is contained in:
Vendored
+2
@@ -774,6 +774,7 @@ async fn process_email_added_events(
|
||||
) -> RustMailerResult<()> {
|
||||
for fetch in fetches {
|
||||
let envelope = extract_envelope(fetch, account.id, &remote.name)?;
|
||||
let thread_id = envelope.compute_thread_id();
|
||||
let message_content = match envelope.body_meta {
|
||||
Some(sections) => {
|
||||
let request = MessageContentRequest {
|
||||
@@ -823,6 +824,7 @@ async fn process_email_added_events(
|
||||
.attachments
|
||||
.as_ref()
|
||||
.map(|atts| atts.iter().cloned().map(Attachment::from).collect()),
|
||||
thread_id,
|
||||
}),
|
||||
),
|
||||
))
|
||||
|
||||
@@ -185,6 +185,7 @@ impl RustMailerEvent {
|
||||
html: Some(String::from("<p>Welcome to use rustmailer!</p>")),
|
||||
},
|
||||
thread_name: Some("Meeting Thread".into()),
|
||||
thread_id: id!(64),
|
||||
reply_to: Some(vec![addr("reply@example.com")]),
|
||||
to: Some(vec![addr("recipient@example.com")]),
|
||||
attachments: Some(vec![Attachment {
|
||||
|
||||
@@ -44,6 +44,9 @@ pub struct EmailAddedToFolder {
|
||||
pub subject: Option<String>,
|
||||
/// Content of the email, including body and related metadata.
|
||||
pub message: MessageContent,
|
||||
/// The identifier of the thread this email belongs to.
|
||||
/// This is computed based on `in_reply_to` / `references` / `message_id`.
|
||||
pub thread_id: u64,
|
||||
/// Optional name of the thread to which the email belongs.
|
||||
pub thread_name: Option<String>,
|
||||
/// Optional list of reply-to addresses for the email.
|
||||
|
||||
Reference in New Issue
Block a user