You need to sign in to do that
Don't have an account?

Email Alert through Workflow does not create an Activity History
Does anyone know why an email alert triggered from a workflow would not be creating the associated activity history? Emails sent through the interface, through Apex, and through the API are all logged in activity history (when the appropriate information is set). The email alert is set to be sent to the Contact Email (standard) field.
Thanks!
I promoted the idea (which I imagine has fallen off the radar because the original idea was posted in 2007) and also just came up with a workaround that might help some others.
First some context. We have a client who wants to have an email automatically sent to leads when they're entered manually, rather than through the web.
To enable this and prevent the wrong leads from getting the introduction, we added a tickbox that users tick if they want leads they're entering to receive the email.
We then created a workflow rule to send an email to the email address of the lead entered. Our expectation was that when this email was sent, the lead's Activity History would be updated.
As we know, this isn't the case. So here's the workaround:
For example, we created a template called "Leads: Auto-Introductory Email to Leads" and a second one called "Leads: Auto-Introductory Email to Leads FOR ACTIVITY HISTORY"
For example, in our duplicated template, we added ref: {!Lead.Id}
All Answers
John,
Any updates?
Thanks!
Update - I was mistaken. Workflow Email Alerts never create activites (confirmed from workflow PM).
I believe I was confusing them with HTML Mass Emails, which are a different breed.
John,
Any way we can get the ability to specify whether or not an Email Alert should create an activity added to Salesforce's road map? Why might someone not want an Email Alert to not create an activity? I will search the Idea Exchange for this suggestion.
Thanks!
If anyone wants this feature, promote this idea:
https://sites.secure.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=08730000000BroKAAS
I promoted the idea (which I imagine has fallen off the radar because the original idea was posted in 2007) and also just came up with a workaround that might help some others.
First some context. We have a client who wants to have an email automatically sent to leads when they're entered manually, rather than through the web.
To enable this and prevent the wrong leads from getting the introduction, we added a tickbox that users tick if they want leads they're entering to receive the email.
We then created a workflow rule to send an email to the email address of the lead entered. Our expectation was that when this email was sent, the lead's Activity History would be updated.
As we know, this isn't the case. So here's the workaround:
For example, we created a template called "Leads: Auto-Introductory Email to Leads" and a second one called "Leads: Auto-Introductory Email to Leads FOR ACTIVITY HISTORY"
For example, in our duplicated template, we added ref: {!Lead.Id}
@SimonSmith
Very clever!
Definitely a clever workaround! It wont work in my particular scenario but, this thread and your workaround is by far the most helpful i have ever found on this topic.
SALESFORCE HEAR ME!!! WE NEED THIS FEATURE.... please?
Hey Simon!
I was trying the same work-around to get an Email Alert into the Activity History, but was having some troubles. I tried the way you had layed out but am wondering where exactly in the Email Template did you Ref: {!Lead.ID}? Does this need any additional coding or to be in the email to SF address? It is not linking for me and I am not understanding how the email to SF is supposed to recognize a Ref from inside the template.
My template is an HTML with a Free-form template. Is that glitching things up?
Thank you for your creativity!
@WOTH
The ref gets populated when the email gets sent. Just put it on its own line. No additional coding required. When the email gets generated, you'll have a line like ref: IDGOESHERE, which Salesforce will read. Just make sure the line looks as follows:
ref: {!lead.id}
That's all, really. If you set things up right, Salesforce will populate that when the email's sent, and read it when the email's received.
@SimonSmith
I must be missing some other step then. On the second email alert you add the Administrator's "Email to Salesforce" address into the "5 extra email" field or do you somehow get that to be the primary email to send to. It allows selection of Users, Related Contacts, etc, but nothing I can see to default to the Email to SF address.
The fact that my email is in an HTML Template with letterhead couldn't possibly mess with the ref: could it?
Otherwise, I'll have to keep playing with it.
Thanks again!
You do need to enable Email-to-Salesforce. To do this, go to: Setup | Email Administration | Email to Salesforce.
IYou can press Help from within that screen to read about that feature, and more about using it.
This works beautifully. Thanks for the valuable contribution.
great work-a-round!
THanks for posting
Nice trick. But looks like this only works for associating emails with matching Opps, Leads or Contacts. Has anybody just used an apex trigger to send the email? Will it or can you save the history that way?
Certainly can see how having activity logged to an object associated with the EmailAlert would be very helpful.
https://sites.secure.force.com/success/ideaView?c=09a30000000D9xt&id=08730000000BroKAAS
I get around this problem by sending an email via APEX called from a trigger. The workflow where I used to do an EmailAlert now sets a checkbox field which the trigger code (on lead object after insert after update) calls an @future method in an an APEX class to send the mail. Works very well yet this and cross object workflow are my biggest disappointments with SFDC workflow. I've solved both problems in triggers. Not having to code, test coverage, and deploy for this type of functionality would be huge.
A different type of workaround for this is creating a workflow task to go along with the alert, and set it to a closed status. It wouldn't capture the entire email, but would track that it was triggered to be sent.
I really wish a workaround was not needed at all.
Great Idea....however, I am having a problem getting Salesforce to automatically assign the email to the related Salesforce.com record based on {!LeadId}. The email are ending up in the Administrators Unresolved Email. I have email associations configured to automatically assign to Leads. Any Ideas?
ProcureCloud,
I think you should have {!Lead.Id} (notice the dot between Lead and Id). You may also need ref: immediately preceeding it. You should be able to see the lead id in the email (when sending and in the activity history). Can you see the Lead Id in the email body of some of the unresolved activities?
Thanks for the reply TRMP,
Format on my email template is
ref:{!Lead.Id}
When the email arrives in my unresolved email, the lead id is shown as follows:
ref:00QU0000003aikp
I did get it to associate by adding my EmailtoSalesforce address as an Addition To : address on the email sent to the lead. That one is associating to the lead record using the email address on the lead record.
Ah, yes. You do need the Email to Salesforce address in there, whether it's the Additional To, CC, or BCC.
I implemented this work aournd successfully but I have the email alerts not only assigned to the leads but also added as unresolved items.
Has anyone else had this and is there a work around?
Thanks
I was able to use SimonSmith's method to log an activity to a custom object, which I didn't think would be possible. Thanks, Simon!
Using an HTML template, I was only able to get this to work with the ref: {!object.id} in the first line of the body.
Great workaround by the way.
I'm trying to set this up in my SFDC instance. I've made sure "Email to Salesforce" is activated for us. I'm stuck on step 3 of Simon's steps. I am creating an email alert and it is asking me to pick a recipient type. I see owners, roles, case teams, etc but don't see anywhere to have it send to only the Email-to-Salesforce email. Anyone have insight into this?
Can you please explain how to proceed from SteP 2. After we have added the Ref ID, how can we create the additional email alert using the cloned template?
Is there really still no better way to do this - it seems absurd that an email sent from a workflow on a case doesn't record the email onto the case it was triggered from...
Keri-An
https://success.salesforce.com/ideaView?id=08730000000BroKAAS
Thanks a lot for your great article.
I dont know why it doesnt work in my organisation.
I tried with the mail-to-Salesforce of 2 administrators.
Does it create a task or a case in the end?
Do i have someting special to configure in order that {!Contact.Id} works?
Thanks a lot for your feedback.
Best
Olivier
The workaround works good, but creates beside the activity history also another unresolved email.
- ref: {!Opportunity.Id} in the template
- sending email from the My Acceptable Email Addresses list
- added my Email to salesforce in the email alert Additional emails
Still, its creating the email task in an unresolved lists. any assistance will be highly valuable as I have hit a blank wallJust a fast lookup for a Task with the Subject: Unresolved email: Subjectname and a fast delete.
that solved the problem for me.