{emayili} Message Precedence

[This article was first published on R - datawookie, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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("[email protected]") %>%
  subject("We've hit an iceberg!") %>%
  priority("urgent") %>%
  importance("high")
Date:                      Tue, 05 Oct 2021 17:32:00 GMT
X-Mailer:                  {emayili}-0.6.1
MIME-Version:              1.0
To:                        [email protected]
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.


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

To leave a comment for the author, please follow the link and comment on their blog: R - datawookie.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)