4

can we mark outgoing mails to high importance either by workflow or by apex code. The way we do in outlook.

outlook message priority selection

3 Answers 3

6

You can do it with Apex code, even though it isn't documented.

public enum Priority {Highest, High, Normal, Low, Lowest}

Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 

email.emailPriority = Priority.Highest.name();

Note, you don't have to use an enum, I just included it so you can see all the possible values. You can just use strings as well.

4
  • You should let the docs team know! The "Yes, except" link in the online help lets you send them a note. Commented Dec 5, 2014 at 5:06
  • Hi Daniel, I was unaware of this. This is exciting.. did you test it ever? Does it work ? Commented Dec 5, 2014 at 8:58
  • What is the resulting email header? Commented Dec 5, 2014 at 13:02
  • Yes, I've tested it and am using it in production. Looks like the header is X-Priority: 1 Commented Dec 5, 2014 at 15:52
0

You could normally do this by setting some SMTP headers, specifically: X-Priority: 1 Importance: high

But it doesn't look like the apex email APIs allow you to set any headers on outbound messages. Looking at the docs for Messaging.SingleEmailMessage shows no methods or other options that seem capable of this. I have to conclude this isn't currently possible.

1
  • It isn't documented, but it is possible! See my answer. Commented Dec 5, 2014 at 5:05
0

In current scenarios, this is not possible, Please vote for below idea:

https://success.salesforce.com/ideaView?id=08730000000IvhPAAS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .