Skip to main content
The Salesforce Log email activity action creates EmailMessage records in Salesforce to log email interactions on CRM records without actually sending the email. This write action accepts structured email content including HTML body and addressing fields from earlier steps in a Glean agent and links the logged email to leads, contacts, opportunities, or cases.

Limitations

  • This action only logs an email as an EmailMessage record and it does not actually send the email. To send, you have to use Salesforce Send email and optionally pair it with Log email activity in the same agent.
  • As with other Salesforce actions, the exact parameter set and behavior can change over time. Confirm how this action behaves in your own environment before you depend on it for large-scale or fully automated contact creation.

Prerequisites

  • Your Salesforce org must be connected as a data source in Glean, and an admin must enable the Salesforce action pack and complete Salesforce Actions Setup including OAuth configuration.
  • Users must authenticate for Salesforce actions on first use and have permission to create EmailMessage records and write to fields such as IsExternallyVisible.

Supported parameters

ParameterTypeDescription
From addressStringEmail address that should be recorded as the sender of the logged email.
Related to IDIntegerID of the record to associate this email with.
SubjectStringSubject line of the email.
To addressStringEmail addresses of the recipients (comma-separated if multiple).
Bcc addressStringBCC email addresses (comma-separated if multiple).
Cc addressStringOne or more CC recipient addresses to store with the logged email.
Html bodyStringHTML body of the email to record as the EmailMessage content.
Is client managedStringWhether the email is client-managed (not sent through Salesforce).
Is externally visibleStringWhether this is an incoming email (true) or outgoing email (false).
Is incomingBooleanWhether this is an incoming email (true) or outgoing email (false).
Message dateDate/timeDate/time the email was sent in ISO format. Defaults to current time if not provided.
Parent IDIntegerID of the parent record, typically a Case for case-related emails.
StatusStringStatus of the email. 0=New, 1=Read, 2=Replied, 3=Sent, 4=Forwarded, 5=Draft Examples: “0” “3” “5”
Text bodyStringPlain text body of the email.

Usage example

You need to log a follow-up email that was sent to a customer about an open support case, recording the email content in Salesforce so your support team has a complete activity history. Instruction to an agent: “Log the follow-up email I sent to [email protected] about Case 00001234 with subject Re: Technical Issue Resolution, including the email body and mark it as sent.” Resulting behavior:
  • Calls a Salesforce search action to find the Case matching “00001234”.
  • Retrieves the Case ID (for example, “500xx000001234567”) and related Contact ID.
  • Calls Log email activity with:
    • From address set to your email address (for example, “[email protected]”).
    • To address set to “[email protected]”.
    • Subject set to “Re: Technical Issue Resolution”.
    • Html body set to the email content with formatting.
    • Text body set to plain text version of the email.
    • Message date set to the current date and time when the email was sent.
    • Parent ID set to “500xx000001234567” (the Case ID).
    • Related to ID set to the Contact ID for John Doe.
    • Status set to “3” (Sent).
    • Is incoming set to false (outgoing email).
    • Is externally visible set to true to make it visible on the customer portal.
  • Creates a new EmailMessage record in Salesforce.
  • The logged email appears in the Case activity timeline.
  • Support team members viewing the Case can see the complete email history.
Workflow tip: Use this action after sending emails outside Salesforce to maintain a complete activity record. For emails sent through Salesforce Send email action, you can either use the built-in logging option or call this action separately for more control. Combine with Salesforce search to find the right Case, Lead, Contact, or Opportunity IDs before logging.

Troubleshooting

  • Possible cause: The Salesforce profile or permission set for the connected user cannot write to the IsExternallyVisible field.
  • Fix: In Salesforce Setup, update field-level security or permission sets so that the profile of the user has write access to IsExternallyVisible or remove this field from the action configuration, if appropriate, then retry the action.
  • Possible cause: The Salesforce OAuth app is not configured correctly (callback URL, Consumer Key, or Consumer Secret), or the user running the agent has not completed the required Salesforce authorization flow from Glean.
  • Fix: Have the user retry the agent and complete the Salesforce auth prompt. If errors persist, a Glean admin must re-check the OAuth setup on the Salesforce Actions Setup page and re-run the configuration steps.

FAQs

This action only logs an email interaction as an EmailMessage record in Salesforce. To actually send an email, use the Salesforce Send email action and, if needed, combine it with Salesforce Log email activity in the same agent.
Use Salesforce Log email activity when you need an explicit, standalone step to record an email interaction, for example, when the email was generated or sent outside Salesforce Send email, or when you want separate control over how and when the activity is logged. Use the log_email flag on Salesforce Send email when you want sending and logging to happen together in one action.