+ Start a Discussion
rtscottrtscott 

Sending Auto-Responses to Different/Additional Addresses?

Hello All,

 

We would like to setup Salesforce.com to deliver auto-response messages on Email-To-Case created Cases to addresses other than the "From" address of the original message. Currently, Salesforce will only deliver an auto-response to the "From" address on the original email. We have a Case trigger than fires on newly created Cases (before insert, before update, after insert, after update) that invokes an Apex class that performs some non-standard Case actions.

 

Is there any way that we can modify the Apex class so that auto-responses are delivered to different/additional addressses outside of the "From" address on the original message? For example, is there a way that we can set it up to deliver an auto-response to the "From" address and any "CC" addresses on the original message?

 

We also have a request to send the auto-response to the "Reply-To" address on the original email. The challenge with this is that there is no specific "Reply-To" field on the EmailMessage object:

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_emailmessage.htm 

 

I found an Idea for this on the Ideas site, but it looks to be pretty dormant:

 

http://ideas.salesforce.com/article/show/10088737/AutoResponse_control_choose_your_destination

 

Anyway, does anybody have ANY ideas on how to accomplish what I have described? Can the auto-responses be controlled through Apex?

 

Thanks in advance for any advice you can offer,

 

-- Rob 

Mehmet_ErgunMehmet_Ergun

You can use Apex Email Service to receive the inbound emails and process outbound messages accordingly.  Using the Inbund email object, you should have no limits to parsing and reading the cc: and reply to addresses and repsonding using the outbound objects.

 

Do a search for Apex Email Classes in the Apex doc http://www.salesforce.com/us/developer/docs/apexcode/index.htm 

 

You can access the following fields in the InboundEmail object: 

An InboundEmail object has the following fields.

NameTypeDescription
binaryAttachmentsInboundEmail.BinaryAttachment[]A list of binary attachments received with the email, if any

Examples of binary attachments include image, audio, application, and video files.

ccAddressesString[]A list of carbon copy (CC) addresses, if any
fromAddressStringThe email address that appears in the From field
fromNameStringThe name that appears in the From field, if any
headersInboundEmail.Header[]A list of the RFC 2822 headers in the email, including:
  • Recieved from
  • Custom headers
  • Message-ID
  • Date
htmlBodyStringThe HTML version of the email, if specified by the sender
plainTextBodyStringThe plain text version of the email, if specified by the sender
replyToStringThe email address that appears in the reply-to header

If there is no reply-to header, this field is identical to the fromAddress field.

subjectStringThe subject line of the email, if any
textAttachmentsInboundEmail.TextAttachment[]A list of text attachments received with the email, if any
The text attachments can be any of the following:
  • Attachments with a Multipurpose Internet Mail Extension (MIME) type of text
  • Attachments with a MIME type of application/octet-stream and a file name that ends with either a .vcf or .vcs extension. These are saved as text/x-vcard and text/calendar MIME types, respectively.
toAddressesString[]The email address that appears in the To field