Added preview to automation intent

pull/215/head
M66B 4 months ago
parent 3c7167cf72
commit dab9c31fb3

@ -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.

@ -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<String> extras = Log.getExtras(automation.getExtras());
EntityLog.log(context, EntityLog.Type.Rules, message,

@ -1675,9 +1675,10 @@ $$aligned$ (since version 1.2049)</code></pre>
<p>The automation action will broadcast the intent <em>eu.faircode.email.AUTOMATION</em> with the following string extras:</p>
<ul>
<li><em>rule</em></li>
<li><em>received</em> (ISO 8601 date/time)</li>
<li><em>sender</em></li>
<li><em>subject</em></li>
<li><em>received</em> (ISO 8601 date/time)</li>
<li><em>preview</em> (since version 1.2222)</li>
</ul>
<p>An app like Tasker can listen for this intent and perform some action. Please <a href="https://tasker.joaoapps.com/userguide/en/intents.html">see here</a> about receiving intents in Tasker.</p>
<p><br /></p>

Loading…
Cancel
Save