{emayili} Message Precedence

Sometimes you need to have a message delivered immediately. Other times it doesn’t matter when it’s delivered. Similarly, you might want the recipient to read a message right now! Or you may not really care when they read it. To address both of these scenarios I have added the ability to specify message priority and importance in {emayili}.

library(emayili)

packageVersion("emayili")
[1] '0.6.1'

Importance

The Importance header specifies how important a message is (surprise!). I guess it really reflects how important the sender thinks the message is, which might not necessarily agree with the recipient’s opinion. According to RFC 4021 this (optional) field can assume one of three values: low, normal or high.

In {emayili} you can set the importance either when creating a message or later.

# Set importance when creating message.
envelope(importance = "low")

# Set importance later.
envelope() %>% importance("high")

Priority

The Priority header is a hint to the mail delivery system about how urgent the message is. Presumably for servers processing a high volume of emails this might influence whether the message is sent immediately or queued to be processed later. According to RFC 4021 this (optional) field can assume one of three values: non-urgent, normal or urgent.

In {emayili} you can set the priority either when creating a message or later.

# Set priority when creating message.
envelope(priority = "non-urgent")

# Set priority later.
envelope() %>% priority("urgent")

An Important and Urgent Message

If you had an important message, you might construct it as follows:

envelope() %>%
  to("edward.smith@titanic.com") %>%
  subject("We've hit an iceberg!") %>%
  priority("urgent") %>%
  importance("high")
Date:                         Thu, 28 Mar 2024 16:35:37 GMT
X-Mailer:                     {emayili}-0.7.18
MIME-Version:                 1.0
To:                           edward.smith@titanic.com
Subject:                      We've hit an iceberg!
Priority:                     urgent
Importance:                   high

It’s important to bear in mind that neither of these fields is binding. They are really only suggestions and can easily be ignored by either server or recipient.


Logo for {emayili} package.

Logo for Fathom Data.

The {emayili} package is developed & supported by Fathom Data.