[SalesForce] Email publisher: Don’t override subject when selecting template

I have a question involving the Case feed email publisher.

For a customer I am currently implementing their Service Cloud. The customer is used to do alot of communication over email and in addition to this they have a lot of email templates they use for communication.

Most part of their customers also have their own ticketing systems so they have an external ticket reference as well. So it's crucial that they maintain the subject of an email if they do a reply.

What happens now and here lies my problem:

  • They make a reply to an email.
  • The subject and previous mail content are filled in in the email publisher.
  • Now the engineer selects a template he wants to use
  • Content of the template is added to the publisher

Now the problem I'm facing is that it also replaces the subject with the one in the template. And this is the behaviour I would like to avoid because when replying on an email with a template my customer wants to keep the original subject of the mail he is replying to.

What I already explored:

I already tried to change the subject in trigger on EmailMessage to replace the subject with the subject of the InReplyTo email. This worked but it only changed the data in Salesforce, the actual mail sent still had the templates subject.

Any idea on the subject is much appreciated as I don't see a real solution to this except to copy the subject before selecting a template, yet that's really the last option :).

Best Answer

I have tried adding {!EmailMessage.Subject} in the subject line of the reply template which I am specifically using to reply to the existing emails from Salesforce. This helps me to retain the subject without it being overwritten by the template selection. The only drawback here is that it would retain the original subject line and not the lates subject line, but I can live with it as of now. SOMETHING IS BETTER THAN NOTHING I guess...

Related Topic