I'd like to export every newsletter email I've ever sent (I send 5 days a wee) to a text file (or pdf) so that I can find a specific section in each newsletter and copy it into an Google sheet. It's a trivia question I ask in every newsletter, and I want to go back and grab every question I've ever asked. Is there an easy way to do this?
To export Salesforce email sends/newsletter history to a file you can search through, here are the main approaches depending on where your newsletter emails are stored:
If you're sending through Salesforce standard Email (not Marketing Cloud): The EmailMessage object stores all sent emails. You can run a SOQL query or Salesforce report to export EmailMessage records including Subject, TextBody, HtmlBody, FromAddress, ToAddress, and MessageDate. From a Report, export to CSV or Excel, then you can search the content.
If you're sending through Marketing Cloud: Use the "Send Log" data extension or the Tracking Extracts feature to export send data and email content. You can access individual email renders through CloudPages or use the Email Tracking reports.
Quick options for search: (1) Salesforce Reports - create a report on Email Messages, export to Excel, and use Excel search. (2) Use the Salesforce Data Export (Setup > Data Export > Export Now) to export EmailMessage as a CSV. (3) If using Marketing Cloud, the Automation Studio tracking extracts can export HTML content.
Note: The body text of emails in Salesforce is stored in TextBody (plain text) and HtmlBody (HTML) fields on the EmailMessage object. A SOQL query like: SELECT Subject, TextBody, MessageDate FROM EmailMessage WHERE FromAddress = 'your@email.com' ORDER BY MessageDate DESC will get all your sent emails.
Mani G | Principal/Founder | https://Keneland.com