Ask Search:
Marge MacedaMarge Maceda 

Auto create tasks after an email is sent

Hi,
Is it possible to use Process Builder or Workflow in auto creating a task after an email is sent related to a record? The email (with a specific Subject filter) will be sent from (A) within Salesforce or (B) Gmail/Outlook but will be recorded in the Activity History. I tried to create a WR but it didn't run after I sent an email. 


Thanks,
Marge
Best Answer chosen by Marge Maceda
Jessie RymphJessie Rymph
That was so fun! I wrote the trigger! https://gist.github.com/forcethesales/0e2e39a1ed74119eac5dbcdc23f8de99
And I wrote a blog post about it because I'm so proud that I can write a trigger! https://unhandledsunshine.com/2018/04/13/building-my-dev-cred

All Answers

Jessie RymphJessie Rymph
hello! Just to understand, you want the Process Builder to check if an email was created, and then create a task. Are you wanting to attach the task to the same record as the email?
Marge MacedaMarge Maceda
Hi Jessie. Yes, I would like the Task to be auto created after a specific email is sent. And yes, I need to attach the Task to the same Custom Object as the email. Thanks!
 
Ken HiveleyKen Hiveley
Hi Marge,

With Process Builders and workflows you can trigger to send tasks based on fields being a certain value or a formula referencing a certain field.  Unfortunately, at this time it is not possilbe to create a criteria based on an email being sent.  If you are looking to create a workflow or process builder that based on a specific criteria then sends an email alert followed by a task that is possible.  Your specific scenario of triggering off a specific subject filter especially with instances of the email being outside of the Salesforce system (Gmail/Outlook) isn't possible.
Marge MacedaMarge Maceda
Hi Ken. Although some emails will be sent outside the Salesforcce system, we will be uploading them into the Salesforce record. When we "upload" those emails as a Task, can that be considered as being "created" and thus trigger a Task creation?
Jessie RymphJessie Rymph
Marge, if you have someone who is developly inclined, they can write a Trigger for when a task is created. Here's another post about it.  https://success.salesforce.com/answers?id=90630000000hL7kAAE
That probably doesn't help you, but maybe you are lucky enough to have a developer!
Marge MacedaMarge Maceda
Thanks for the link, Jessie! We unfortuntaley do not have a developer. I also just bookmarked this link (https://developer.salesforce.com/events/webinars/apex-for-admins-in-30-mins?d=70130000000hUks) (same person in your link). Thanks for pointing me in the right direction.
Jessie RymphJessie Rymph
That was so fun! I wrote the trigger! https://gist.github.com/forcethesales/0e2e39a1ed74119eac5dbcdc23f8de99
And I wrote a blog post about it because I'm so proud that I can write a trigger! https://unhandledsunshine.com/2018/04/13/building-my-dev-cred
This was selected as the best answer
Marge MacedaMarge Maceda
Hi Jessie, I will definitely reach out to you as I have zero idea as to what to do next.

PS. I'm already digging through unhandledsunshine.com (https://unhandledsunshine.com/contributors/) and have bookmarked RAD Women (http://radwomen.org/). You are an inspiration!