Add one-click unsubscribe detection and warning
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Detect the List-Unsubscribe-Post: List-Unsubscribe=One-Click header (RFC 8058) and expose it as the 'one-click' unsubscribe method in the content analysis. When unsubscribe methods are present but one-click is absent, the summary card now shows a warning nudging senders to adopt it.
This commit is contained in:
parent
96e83ff70d
commit
8fda7746a1
2 changed files with 33 additions and 5 deletions
|
|
@ -422,6 +422,17 @@
|
|||
});
|
||||
}
|
||||
|
||||
// One-click unsubscribe check
|
||||
const unsubscribeMethods = report.content_analysis?.unsubscribe_methods;
|
||||
if (unsubscribeMethods && unsubscribeMethods.length > 0 && !unsubscribeMethods.includes("one-click")) {
|
||||
segments.push({ text: ". This email could benefit from " });
|
||||
segments.push({
|
||||
text: "one-click unsubscribe",
|
||||
highlight: { color: "warning", bold: true },
|
||||
link: "#content-details",
|
||||
});
|
||||
}
|
||||
|
||||
// Content/spam assessment
|
||||
const spamAssassin = report.spamassassin;
|
||||
const contentScore = report.summary?.content_score || 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue