Thursday, January 30, 2020

Fetch All Workflow Email Alert Details Related to Object Using Tooling API

Through this blog, I will sharing script which can help to get complete information about all the email alerts configured in Salesforce using workflow rules for any sObject.

Imagine a scenario in which you need to extract all email alert configured or created for different workflow rules for specific object so that it can be reviewed or analyzed. If you do this activity manually then you have to open each workflow email alert and note down details like recipient, ccEmails, senderAddress, email template etc. This will be very hectic if you have lots of email configured.

In order to solve this scenario, I am using Tooling API through which we can get complete details about workflow email alert. Through apex script, we can generate these details and send email (with csv file as attachment) to user with all details.

First of all, inorder to parser JSON response, we need to create apex class (SK_EmailAlertJSONParser) which will act as parser for JSON. After this we can run the script in developer console and user will get email with all information regarding email alert.


Below is snapshot of csv file that we will receive after running above script in developer console.
I have specified objectId as "Contact". For custom object, specify 15 digit or 18 digit id.


This script can be used to fetch information from other salesforce org also. Suppose you don't want to deploy this script in production, then save SK_EmailAlertJSOnParser class in sandbox and in developer console (using execute anonymous window)  just specify the domainUrl for production and sessiond id production for admin user.

Don't forget to add domainUrl in remote site settings before running this script in execute anonymous window in developer console.

Hope this will help!!1

33 comments:

  1. Thanks for sharing this useful information, really helped me a lot. In the recent announcement from Salesforce, I heard they have launched LWC Local Development Beta program. Can you please tell me more about that. As a Salesforce consulting partner, It's a great news for us.

    ReplyDelete
  2. Hi there, I read your blogs on a regular basis. Your humoristic style is witty, keep it up! Thank You for Providing Such a Unique and valuable information, If you are looking for the best Serp Api, then visit SERP House. I enjoyed this blog post.

    ReplyDelete
  3. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. active response training

    ReplyDelete
  4. Hi Please help why is it returing only one row ..I ran this is anonymous window. and getting only 1 row ..
    string sessionId= UserInfo.getSessionID();
    string domainUrl=URL.getSalesforceBaseUrl().toExternalForm();
    system.debug('********domainUrl:'+domainUrl);
    string objectId ='Email Alerts'; //for custom objects, provide 15 digit or 18 digit object id
    HttpRequest req = new HttpRequest();
    req.setHeader('Authorization', 'Bearer ' + sessionId);
    req.setHeader('Content-Type', 'application/json');
    req.setEndpoint(domainUrl+'/services/data/v47.0/tooling/query/?q=select+id,SenderType,templateId+from+WorkflowAlert');
    req.setMethod('GET');
    Http h = new Http();
    HttpResponse res = h.send(req);
    system.debug(JSON.serializePretty(res.getBody()));

    I need to get all the email Additional Email field how to do that .. Also kindly help is this class needs to execute only in anonymous window.. my require is to fetch all the workflowemailalert additional email field and update it with .invalid suffix in lower sandbox.. how to achive the whole flow please help

    ReplyDelete
    Replies
    1. Hi,
      Did you got any solution for this. If yes can you please send the script here.

      Delete
  5. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. g licensing

    ReplyDelete
  6. Can you please help me to update ccEmail field with the code please this is very urgent

    ReplyDelete
  7. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you. hotmail

    ReplyDelete
  8. With an email scraping spider collecting programming you will have the option to manufacture your rundown a lot faster as it will insect its way through different web indexes and assemble URL's that meet the inquiry dependent on catchphrases.

    ReplyDelete
  9. He ordinarily doesn't get a high level of deals, on the grounds that a great many people quickly erase emails that they think are spam. Bulk Email Sender

    ReplyDelete
  10. Hi, not a developer in the least. I tested this in our sandbox with success, but I need it in production. The only way I know to do that is to push a deployment of the SK_EmailAlertJSONParser.cls apex class to production, then run the script in the Dev Console. However, I cannot deploy this to prod without a test class. Do you have a test class framework to go along with the SK_EmailAlertJSONParser.cls class?

    ReplyDelete
  11. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. freeware bulk email extractor

    ReplyDelete
  12. Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. gmass account login

    ReplyDelete
  13. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. how to send thousands of emails

    ReplyDelete
  14. Hi there! Nice material, do keep me posted when you post something like this again! I will visit this blog leaps and bounds for more quality posts like it. Thanks... one funnel away challenge

    ReplyDelete
  15. I've proper selected to build a blog, which I hold been deficient to do for a during. Acknowledges for this inform, it's really serviceable! Email Harvester

    ReplyDelete
  16. I have read all the comments and suggestions posted by the visitors for this article are very fine,We will wait for your next article so only.Thanks! Zendable

    ReplyDelete
  17. which you need to extract all email alert configured or created for different workflow rules for specific object so that it can be reviewed or analyzed. If you do this activity manually.Sony Vegas Pro crack

    ReplyDelete
  18. This script can be used to fetch information from other salesforce org also. Suppose you don't want to deploy this script in production, then save SK_EmailAlertJSOnParser class in sandbox and in developer console (using execute anonymous window) just specify the domainUrl for production and sessiond id production for admin user uTorrent Pro Crack with Activation Code

    ReplyDelete
  19. I've proper selected to build a blog, which I hold been deficient to do for a during. Acknowledges for this inform, it's really serviceable.Activators for Windows

    ReplyDelete
  20. Thanks for sharing this useful information, really helped me a lot. In the recent announcement from Salesforce, I heard they have launched LWC Local Development Beta program. Can you please tell me more about that. As a Salesforce consulting partner, It's a great news for us. I have read all the comments and suggestions posted by the visitors for this article are very fine, We will wait for your next article so I can increase my knowledge
    Zentimo xStorage Keygen

    ReplyDelete
  21. I've proper selected to build a blog, which I hold been deficient to do for a during. Acknowledges for this inform, it's really serviceable.FileZilla Pro Crack

    ReplyDelete
  22. Great work with hard work you have done I appreciate your work thanks for sharing it.
    Zentimo xStorage Manager Crack

    ReplyDelete
  23. What sorts of emails to anticipate from you later on
    Why you're really amazing specialist to assist them with purchasing or sell their home. GMX Mail Login

    ReplyDelete
  24. buy twitch followers Battlefield 3 was released at the same time at Modern Warfare 3. With two huge First person shooter games being released just a few days apart, the competition for #1 console FPS game began. Did Battlefield 3 come out on top? Is Battlefield 3 the better shooter? Check out this review to find out!

    ReplyDelete
  25. https://www.visualaidscentre.com/service/eyes-specialist-delhi/ A home improvement loan is actually one of the simplest ways in which you can live in your dream home. This is because it is the prime option for someone wanting to enhance the appearance of their home and also add to the value. In other words, a home improvement loan pays off in many ways.

    ReplyDelete
  26. Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. download ExpressVPN

    ReplyDelete
  27. https://www.visualaidscentre.com/lasik-eye-surgery-in-delhi/ State-of-the-art coolness and state-of-the-art game design just got ratcheted up to a new level. There are funny games and apps galore to be found on dynamic new web portals. You can find reliable web portals on the internet.

    ReplyDelete
  28. Welcome to the future! Financing made easy with Prof. Mrs. DOROTHY JEAN INVESTMENTS

    Hello, Have you been looking for financing options for your new business plans, Are you seeking for a loan to expand your existing business, Do you find yourself in a bit of trouble with unpaid bills and you don’t know which way to go or where to turn to? Have you been turned down by your banks? MRS. DOROTHY JEAN INVESTMENTS says YES when your banks say NO. Contact us as we offer financial services at a low and affordable interest rate of 2% for long and short term loans. Interested applicants should contact us for further loan acquisition procedures via Whatsapp Number +1(541)279-1406 Email profdorothyinvestments@gmail.com

    We invest in all profitable projects with cryptocurrencies. I'm here to share an amazing life changing opportunity with you. its called Bitcoin / Forex trading options, Are you interested in earning a consistent income through binary/forex trade? or crypto currency trading. An investment of $100  or  $200 can get you a return of $2,840 in 7 days of trading and you get to do this from the comfort of your home/work. It goes on and on The higher the investment, the higher the profits. Your investment is safe and secured and payouts assured 100%. if you wish to know more about investing in Cryptocurrency and earn daily, weekly OR Monthly in trading on bitcoin or any cryptocurrency and want a successful trade without losing Contact MRS.DOROTHY JEAN INVESTMENTS  Email profdorothyinvestments@gmail.com


    YOURS IN SERVICE
    Mrs. Dorothy Pilkenton Jean
    Financial Advisor on Bank Instruments,
    Private Banking and Client Services
    Whatsapp Number +1(541)279-1406
    Email Address: profdorothyinvestments@gmail.com
    Operation: We provide Financial Service Such As Bank Instrument
    From AA Rate Banks, Cash Loan,BG,SBLC,BOND,PPP,MTN,TRADING,FUNDING MONETIZING etc.

    ReplyDelete

  29. Up until this point, the crypto cash market has kept away from numerous administration and customary bank monetary issues and traps, and B lockchain innovation can possibly take care of a lot more issues. NFT Mint Calenda

    ReplyDelete