diff --git a/FAQ.md b/FAQ.md index b1f2158e95..1ef734ea55 100644 --- a/FAQ.md +++ b/FAQ.md @@ -3020,9 +3020,10 @@ Note that not all email servers support IMAP keywords. The automation action will broadcast the intent *eu.faircode.email.AUTOMATION* with the following string extras: * *rule* +* *received* (ISO 8601 date/time) * *sender* * *subject* -* *received* (ISO 8601 date/time) +* *preview* (since version 1.2222) An app like Tasker can listen for this intent and perform some action. Please [see here](https://tasker.joaoapps.com/userguide/en/intents.html) about receiving intents in Tasker. diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 9456338f0b..5dc29f5c25 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -147,10 +147,11 @@ public class EntityRule { static final String ACTION_AUTOMATION = BuildConfig.APPLICATION_ID + ".AUTOMATION"; static final String EXTRA_RULE = "rule"; + static final String EXTRA_RECEIVED = "received"; static final String EXTRA_SENDER = "sender"; static final String EXTRA_NAME = "name"; static final String EXTRA_SUBJECT = "subject"; - static final String EXTRA_RECEIVED = "received"; + static final String EXTRA_PREVIEW = "preview"; static final String[] EXTRA_ALL = new String[]{ EXTRA_RULE, EXTRA_SENDER, EXTRA_NAME, EXTRA_SUBJECT, EXTRA_RECEIVED @@ -1246,10 +1247,11 @@ public class EntityRule { Intent automation = new Intent(ACTION_AUTOMATION); automation.putExtra(EXTRA_RULE, name); + automation.putExtra(EXTRA_RECEIVED, DTF.format(message.received)); automation.putExtra(EXTRA_SENDER, iaddr == null ? null : iaddr.getAddress()); automation.putExtra(EXTRA_NAME, iaddr == null ? null : iaddr.getPersonal()); automation.putExtra(EXTRA_SUBJECT, message.subject); - automation.putExtra(EXTRA_RECEIVED, DTF.format(message.received)); + automation.putExtra(EXTRA_PREVIEW, message.preview); List extras = Log.getExtras(automation.getExtras()); EntityLog.log(context, EntityLog.Type.Rules, message, diff --git a/index.html b/index.html index d2ed2b8be6..6f780ddaeb 100644 --- a/index.html +++ b/index.html @@ -1675,9 +1675,10 @@ $$aligned$ (since version 1.2049)

The automation action will broadcast the intent eu.faircode.email.AUTOMATION with the following string extras:

An app like Tasker can listen for this intent and perform some action. Please see here about receiving intents in Tasker.